You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In angular 16.1.4, the demo example is not working. When I scroll down, some little movements appear in the table but table does not render the needed rows. Let's say I have 1000 rows, it always shows first n (e.g 10) rows. This could be the angular material tab's change detection mechanism due to performance considerations.
Note: I have found a little workaround for this by calling detectChanges method from ChangeDetectorRef of the component whenever scroll index is changed.
The text was updated successfully, but these errors were encountered:
Note: I have found a little workaround for this by calling detectChanges method from ChangeDetectorRef of the component whenever scroll index is changed.
Hey, having the same issue, where can i get scroll index? @yusufakyol2597pc
onScrolledIndexChanged(index: number): void{constfixedIndex: number=parseInt(index.toFixed(),10);// this is needed, I don't know why but index was a float in my caseconsole.log("scroll index",fixedIndex);this.changeDetectorRefs.detectChanges();}
fixedIndex will be the scrolled index. detectChanges() call will detect the changes and fix the not rendering problem as a workaround.
Finally, in component's html template, give this method to the event of the cdk-virtual-scroll-viewport called scrolledIndexChange like:
In angular 16.1.4, the demo example is not working. When I scroll down, some little movements appear in the table but table does not render the needed rows. Let's say I have 1000 rows, it always shows first n (e.g 10) rows. This could be the angular material tab's change detection mechanism due to performance considerations.
Note: I have found a little workaround for this by calling detectChanges method from ChangeDetectorRef of the component whenever scroll index is changed.
The text was updated successfully, but these errors were encountered: