How to use ngx-infinite-scroll in mat-autocomplete

109 Views Asked by At

I want to use ngx-infinite-scroll in mat-autocomplete but seems that it does not triggered scrolled event when scroll bar reach to the end of mat autocomplete panel.

What I tried: complete code is Here

<input type="text"
       matInput
       [matAutocomplete]="auto1"/>
  <mat-autocomplete
    #auto1="matAutocomplete"
    [class]="'blue-bg'"
    infiniteScroll
    [infiniteScrollDistance]="2"
    [infiniteScrollUpDistance]="15"
    (scrolled)="onScroll()">
    <mat-option *ngFor="let option of simpleOptions.slice(0, 30)"
      [value]="option">
      {{ option }}
    </mat-option>
  </mat-autocomplete>

and in the component class I have:

  onScroll() {
    console.log('load more data');
  }

My expectation is when the scroll bar reached to the end of the panel, onScroll methods would be called.

0

There are 0 best solutions below