Description
Bug Report
Ionic version:
[ ] 4.x
[x] 5.x
Current behavior:
When using ion-nav pop() method page persist in DOM
Expected behavior:
Page should be removed from DOM
Steps to reproduce:
First there should be ion-nav and ion-router-outlet on the same level for bug to be reproducible. Page that are loaded via router-outlet should also contain an instance of ion-nav and when using that instance for pushing and popping the pages are not getting destroyed or rather they stay in DOM with display: none.
Using the project provided below steps to reproduce are:
- Click on header("Go to Second page") to open second ion-nav
- Click on "PUSH"
- Click on "POP"
Inspect html structure and you will see the child component is still in DOM even though we popped it.
Related code:
Here is the minimal structure needed for the bug to reproduce https://github.com/Gorshtak/bug-ion-nav