rintoj / ngx-virtual-scroller

Virtual Scroll displays a virtual, "infinite" list.
https://rintoj.github.io/ngx-virtual-scroller
MIT License
979 stars 295 forks source link

[Angular 5.2.x] - Page get stucked with ngx-virtual-scroller #536

Open sohaieb opened 2 years ago

sohaieb commented 2 years ago

Hello, I recently installed ngx-virtual-scroller for my Angular: 5.2.5 project to use, but when I route to the component (page) which contains ngx-virtual-scroller it stuck and all the page get blocked until I close the hole Brows Tab

Here is the chunk of code i used inside the view: (the parent is scrollable)

<div #scrolledContainer class="shared-table-scrolled-content">
    <div class="shared-table-rows">

      <!-- Data Rows -->
      <virtual-scroller #scroll [items]="rows" [parentScroll]="scrolledContainer">
        <div class="shared-table-row"
             *ngFor='let row of scroll.viewPortItems; let i = index, let last = last;  trackBy: trackByFnInpt.trackByFn'
            [class.last-row]="last"
        >
          <ng-container *ngTemplateOutlet="rowsContentRef;context: {rows: rows, row: row, i: i}"></ng-container>
        </div>
      </virtual-scroller>
      <div class="shared-table-row empty-table" *ngIf="!rows || !rows.length">
        No records found.
      </div>
    </div>
  </div>

the installed version of ngx-virtual-scroller is ngx-virtual-scroller@4.0.3

floogulinc commented 2 years ago

Angular 5 is nearly 5 years old. This project has a peer dependency of Angular 6 or higher. I suggest you update Angular and see if that helps.

sohaieb commented 2 years ago

@floogulinc thank you for your reply, Actually, we can not upgrade the angular version of the current projet because we will face a very big and difficult amount of changes to handle to the hole app. That's why I'm searching for an alternative solution to this problem.