w11k / angular-sticky-things

Sticky Directive for Angular 2+

Home Page:https://w11k.github.io/angular-sticky-things

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Infinite scroll event on Firefox

csimpi opened this issue · comments

commented

Hi,
thank you for this awesome directive!

Interestingly, I'm having an issue with Firefox. When I scroll down the scrolling event is getting in an infinite loop, I have no idea why.

I've changed the source code and added a console.log message:

        this.listener = function (e) {
            /** @type {?} */
            console.log('SCROLL EVENT');
            var upperScreenEdgeAt = (/** @type {?} */ (e.target)).scrollTop || window.pageYOffset;
            _this.scroll$.next(upperScreenEdgeAt);
        };

When I scroll down and reach the sticky element, The SCROLL EVENT message is appering in the console thousands of times within a couple of sec, it never stops, only if I scroll back to the top.

I've tested sticky thing demo page with firefox and worked perfectly, maybe something is incompatible with my code, but I haven't found any clue.

This doesn't happen with Chrome, or Safari only Firefox.
Thanks for any suggestions!

UPDATE:
When I wrap the whole website into a flexbox with flex-column the issue disappears.