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

how to use infiniteScrollDistance? scrolled event fires no matter what value #339

Closed henryyue2010 closed 4 years ago

henryyue2010 commented 5 years ago

I followed the example.

<div
      class="search-results"
      infiniteScroll
      [infiniteScrollDistance]="2"
      [infiniteScrollThrottle]="50"
      (scrolled)="onScroll()"
    ></div>

but the scrolled event fires right after the page scrolls, no matter the value of infiniteScrollDistance. How to make it work? Thank you very much in advance for your help.

Expected Behavior

Scrolled to the expected position, then the scrolled event fires.

Actual Behavior

the scrolled event fires right after the page scrolls.

Possible Solution

Steps To Reproduce / Demo (if applicable)

[ ] Please share a stackblitz or plunkr demo reproducing this issue

Context

Your Environment

orizens commented 4 years ago

infiniteScrollDistance is sensitive - try out the demo.