7

i'm using ngx-infinite-scroll module with Angular 5. My browser is Chrome.

The onScrollDown() action is fired when i scroll down with the scrolling bar inside my div. To make it work, i need to give a height to my content and [scrollWindow] should be set to false:

css

 .search-results {
      height: 200px;
      overflow: scroll;
    }

template

<div class="search-results"
         infinite-scroll
         [infiniteScrollDistance]="5"
         [infiniteScrollThrottle]="10"
          [scrollWindow]="false"
         (scrolled)="onScrollDown()">
      <p *ngFor="let i of array">
        {{i}}
      </p>
    </div>

But when i set [scrollWindow] to true (which is the default setting), and remove the search-results class (no height set then), the onScrollDown() is never fired even when i scroll down with the default right bar of my browser. Any idea why the default windows scrolling doesnt trigger the onScollDown() action? Thanks

Kivo
  • 317
  • 5
  • 19

1 Answers1

0

I found that even though the documentation claims that windowScrolled default it's true if I don't set it explicitly to true the listened is not bound to the window scroll.

Kerby82
  • 4,356
  • 12
  • 41
  • 65