Takes a long time for onScroll to fire
See original GitHub issueI have
<div class="search-results"
infiniteScroll
[infiniteScrollDistance]="2"
[infiniteScrollThrottle]="500"
(scrolled)="onScroll()">
</div>
When I scroll to the bottom, it somtimes takes 4 seconds for onScroll to fire.
I’ve tried all kinds of values for infiniteScrollDistance. With a high value, it works initially, but after scrolling for a while, the problem is back.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:28 (19 by maintainers)
Top Results From Across the Web
Scroll event firing too many times. I only want it to fire a ...
One way to solve this problem is to define a time interval and only process a scroll event once within that time interval....
Read more >Quick Tip: How to Throttle Scroll Events - SitePoint
Given the size of the page, it takes many seconds to scroll through content. This enables throttling to fire the event only once...
Read more >How to develop high performance onScroll event?
The onscroll event trigger interval time is around 10~20ms when we scrolling the mouse wheel. However, in most cases we don't need the...
Read more >Scroll Events and Intersection Observer - Beginner JavaScript
In this video we will learn about scroll events. A scroll event is when someone goes ahead and scrolls on the page or...
Read more >.scroll() | jQuery API Documentation
Now when the user scrolls the text up or down, one or more messages are appended to <div id="log"></div> : Handler for .scroll()...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I experienced this issue also in Chrome (OS X), but not in other browsers. Happens still with new 0.8.1. It seems that the problematic part is the sampleTime() as adrienverge found out above. I think the root cause might be this: https://bugs.chromium.org/p/chromium/issues/detail?id=661155
sampleTime() uses timeout and while scrolling - especially rapidly with track pad - the events won’t arrive. After the scrolling is stopped, it takes couple of seconds and everything is working again.
I wonder if the semantics of the scroll throttle option could be changed a bit, so that 0 would leave the sampleTime() part out totally?
I have opened https://github.com/orizens/ngx-infinite-scroll/pull/235, it solves the problem for me when using
[infiniteScrollThrottle]="0"
.