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

The navtab content DOM will NOT be destroyed if it is not active #3930

Closed
javix opened this issue Jan 6, 2021 · 1 comment · Fixed by #3934
Closed

The navtab content DOM will NOT be destroyed if it is not active #3930

javix opened this issue Jan 6, 2021 · 1 comment · Fixed by #3934

Comments

@javix
Copy link

javix commented Jan 6, 2021

Bug description:

The tab content DOM will NOT be destroyed if it is not not active, when the component is using onPush change detection. It is very critical for me because I use components as content templates and I expect a new instance every time the tab is activated.

screenshot

Link to minimally-working StackBlitz that reproduces the issue:

https://angular-b2j9uy.stackblitz.io

If you switch between the tabs, the last two always stay in the DOM.

Versions of Angular, ng-bootstrap and Bootstrap:

Angular: 11.0.5

ng-bootstrap: 8.0.1

@maxokorokov
Copy link
Member

Yep, it's a regression, thanks for reporting.
It seems we need to mark nav outlet for check after the fade out transition is finished.

@javix javix changed the title The navtab content DOM will NOT be destroyed if it is not not active The navtab content DOM will NOT be destroyed if it is not active Jan 6, 2021
maxokorokov added a commit to maxokorokov/ng-bootstrap that referenced this issue Jan 8, 2021
A regression introduced with animations.
We already have all tests in place that cover the use case in the issue if we mark `ngbNavOutlet` with `OnPush` itself.

Fixes ng-bootstrap#3930
maxokorokov added a commit that referenced this issue Jan 8, 2021
A regression introduced with animations.
We already have all tests in place that cover the use case in the issue if we mark `ngbNavOutlet` with `OnPush` itself.

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

Successfully merging a pull request may close this issue.

2 participants