Scrolled callback called on each scroll
See original GitHub issueHi,
The callback scrolled is called each time I used the mouse wheel, I try several configurations but none solved my issue.
This template is encapsulated in a body :
<div class="col-md-4 infinite-container" infinite-scroll [infiniteScrollThrottle]="1000" (scrolled)="onScrollDown()">
<div class="content">
<h1>{{ 'ADVERTISEMENT.SEARCH' | translate }}</h1>
</div>
<div class="content selectable" *ngFor="let result of results" (click)="onSelect(result)" [ngClass]="{'active' : isActive(result) }">
<h4>{{ result.title }}</h4>
<p>{{ result.price }} €</p>
</div>
</div>
.infinite-container {
height: 1000px;
}
Am I doing it wrong?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:17 (4 by maintainers)
Top Results From Across the Web
Is there a callback for window.scrollTo? - Stack Overflow
I don't really know if a call back exists for scrollTo() but I think you can try setTimeout() only if you know 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 >Quick Tip: How to Throttle Scroll Events - SitePoint
The browser will execute the callback every single time the user scrolls, which can be many events per second. If the callback performs...
Read more >Document: scroll event - Web APIs - MDN Web Docs - Mozilla
The scroll event fires when the document view has been scrolled. To detect when scrolling has completed, see the Document: scrollend event.
Read more >Decouple the scroll event from the callback functions using ...
r/javascript - scrolling.js: Decouple the scroll event from the callback ... a bad idea considering every device and browser calls the event differently...
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
My issue was fixed by adding the missing DOCTYPE atrribute on the top of my html index file as mentioned here :
https://github.com/orizens/angular2-infinite-scroll/issues/7
😉
I was having the exact same problem. Solved it by changing the code from:
To: