ngx-infinite-scroll: Cannot read property 'nativeElement' of null

Hi

Everytime, I tried to use your ngx-infinite-scroll inside a <md-tab></md-tab> I get the following error:

Cannot read property 'nativeElement' of null

Maybe the component is not ready yet, I don’t know but I didn’t have any condition to hide it. If it’s not in a <md-tab> it works well 😃

This is my snippet code:

 <md-tab label="{{'TITLE' | translate}}">
                <md-card *ngIf="displayManagerCard$ | async">
                    <md-card-content>
                        <app-users-manager [userId]="userId"></app-users-manager>
                    </md-card-content>
                </md-card>
   </md-tab>

<app-users-manager> HTML:

  <app-display-list-users [infoToDisplay]='myObs$ | async' (onScroll)="scroll()"></app-display-list-users>

<app-display-list-users> HTML:

<div class="infiniteScroll" fxLayoutWrap fxLayout="row" infiniteScroll [infiniteScrollDistance]="1" infiniteScrollContainer=".display-list-users-component"
  [scrollWindow]="false" (scrolled)="onScroll.emit()">
  <div fxFlex="100" class="display-list-users-component">fdghjdfhgjdfhgjfdgjfd</div>
</div>

Thank you in advance

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 26 (9 by maintainers)

Most upvoted comments

@kevincaradant thanks for reproducing. i reopened this one - i have a direction of how to fix this.

I updated my node and npm versions and it solved! 😃