There is a angular grid with scrollbar and on scroll we need to call the scroll event (lazy loading).
<div class="table-container" [ngClass]="{'loading': isLoading}" style="max-height: 400px; overflow-y: auto;"
infinite-scroll
[infiniteScrollDistance]="2"
[infiniteScrollThrottle]="150"
(scrolled)="onScroll($event)">
<table [dataSource]="dataSource" matSort cdk-table class="nest-table">
</table>
</div>
but onScroll event is not getting triggered during grid scrollbar scrolling. Please have a look and suggest.
scrolledis not a native event, I suppose it is provided by theinfinite-scrolldirective. Where does this directive come from? I have never seen this in Angular or Angular Material.scrolledevent is only emitted when the threshold has been reached, while the nativescrollevent emits on every scroll.table-containerelement and not some other element like the table. By applying a max-width and overflow-y, it looks like that's the case, however from the given code we can't be 100% sure. Without a minimal reproducible example it's hard to help here.