diprokon / ng-table-virtual-scroll

Virtual Scroll for Angular Material Table
https://diprokon.github.io/ng-table-virtual-scroll
MIT License
133 stars 41 forks source link

Empty body if parent tag started in hidden state #106

Open Martin-Hogge opened 1 year ago

Martin-Hogge commented 1 year ago

I step on an issue where, if the parent tag of the cdk-virtual-scroll-viewport start with [hidden]="true" then when the div becomes visible the tbody of the table is empty.

I reproduced it on stackblitz: https://stackblitz.com/edit/angular-kfegg3?file=src/app/base-example.component.html


Solution: If I set loading to false as default value instead of true and setting it to true only in the ngAfterViewInit this is fixing it but I think this could be useful to share.

Martin-Hogge commented 1 year ago

I didn't manage to reproduce it on stackblitz but I also had the issue where a parent tag (multiple levels up in the hierarchy) has a ngIf resolving to false on startup and when becoming true the table has no body.

Is their something I can do to prevent this behaviour ? I don't want to let the div always visible.