I'm using Angular 8's table (not using flex) with first 2 columns as sticky.
Issue :
Reproducing the issue.
Use Angular's table example with sticky columns. https://stackblitz.com/angular/lynkxvonedv?file=src%2Fapp%2Ftable-sticky-columns-example.html

Thanks in Advance.
I found a workaround which may help you.
constructor(private ngZone: NgZone) {}
ngAfterViewInit() {
this.ngZone.onMicrotaskEmpty.pipe(take(3)).subscribe(() => this.table.updateStickyColumnStyles());
}
GitHub Link: https://github.com/angular/components/issues/15885
For me mat table was inside a *ngIf condition so I have to do something like below.
@ViewChild('matTable', { static: false }) set table(matTable: MatTable<any>) {
if (matTable) {
this.ngZone.onMicrotaskEmpty
.pipe(take(3))
.subscribe(() => matTable.updateStickyColumnStyles())
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With