orizens / ngx-infinite-scroll

Infinite Scroll Directive for Angular
https://www.npmjs.com/package/ngx-infinite-scroll
MIT License
1.23k stars 223 forks source link

Scroll event not fired when fast scrolling to the end of the page #379

Closed KessoumML closed 3 years ago

KessoumML commented 3 years ago

Your issue may already be reported! Please search on the issue track before creating one.

Expected Behavior

scrolled event should fire when scrolling fast to the end of the page.

Actual Behavior

Scrolling quickly with mouse wheel or with "end" keyboard button is not firing scroll event until we scroll back up a little bit.

Possible Solution

Steps To Reproduce / Demo (if applicable)

Go to this stackblitz. Select preview window. Scroll to the end with "end" button (sometimes also happens with fast mouse wheel scrolling) https://stackblitz.com/edit/angular-ivy-nc2xc6?file=src%2Fapp%2Fhello.component.ts

Context

Cannot know if I reached the end to load new ressources.

Your Environment

KessoumML commented 3 years ago

The issue solved by setting throttle time to a minimum value that could trigger the scrolled event. I used infiniteScrollThrottle: 20and it just worked!