Angular 5 with ngx infinite scroll not fired
Asked Answered
E

1

6

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

Eldwun answered 15/12, 2017 at 19:57 Comment(1)
Right now the plugin has this issue, it's a shame! (11/04/2018)Parathion
S
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.

Sonics answered 9/2, 2018 at 22:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.