Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty body if parent tag started in hidden state #106

Open
Martin-Hogge opened this issue Aug 5, 2022 · 1 comment
Open

Empty body if parent tag started in hidden state #106

Martin-Hogge opened this issue Aug 5, 2022 · 1 comment

Comments

@Martin-Hogge
Copy link

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant