Skip to content

Commit

Permalink
perf(module:table): spawn timers and add listener outside of the zone
Browse files Browse the repository at this point in the history
  • Loading branch information
arturovt committed Dec 23, 2021
1 parent ab78821 commit 34064cf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions components/table/src/table/table-inner-scroll.component.ts
Expand Up @@ -152,10 +152,13 @@ export class NzTableInnerScrollComponent<T> implements OnChanges, AfterViewInit,
overflowX: this.scrollX ? 'auto' : null,
maxHeight: this.scrollY
};
this.scroll$.next();
// Caretaker note: we have to emit the value outside of the Angular zone, thus DOM timer (`delay(0)`) and `scroll`
// event listener will be also added outside of the Angular zone.
this.ngZone.runOutsideAngular(() => this.scroll$.next());
}
if (data) {
this.data$.next();
// See the comment above.
this.ngZone.runOutsideAngular(() => this.data$.next());
}
}
ngAfterViewInit(): void {
Expand Down

0 comments on commit 34064cf

Please sign in to comment.