orizens / ngx-infinite-scroll

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

fix(attachScrollEvent): Add trailing:true to throttleTime #386

Closed IT-Smile closed 2 years ago

IT-Smile commented 2 years ago

A similar PR may already be submitted! Please search among the Pull request before creating one.

Thanks for submitting a pull request! Please provide enough information so that others can review your pull request.

Summary

This PR fixes/implements the following bugs/features

Explain the motivation for making this change. What existing problem does the pull request solve?

When scrolling too fast, it may miss to capture some scrolling event that would have triggered the scrolled / scrolledUp event. This PR fix this issue by setting the trailing attribute to true in throttleTime. This will emit the last value received at the end of the throttle interval, solving this problem.

Requirements

Make sure these boxes are checked:

eliakocher commented 2 years ago

this is a serious problem, i hope this PR will be accepted soon

TobiasKrogh commented 2 years ago

@orizens do you see any chance of accepting this PR and releasing a new version?

Zerounodue commented 2 years ago

would be nice to see a new version 👍

orizens commented 2 years ago

thanks @IT-Smile after many efforts, version 13.1.0-next is available for testing try to install with

npm i ngx-infinite-scroll@next

or test with https://stackblitz.com/edit/ngx-infinite-scroll-wemchd?file=package.json

IT-Smile commented 2 years ago

@orizens Your welcome. We thank you for you hard work and your time in order to provide this new version. I just test the case on stackblitz and it is solved.

Again thank you a lot! :-)