Skip to content

bug: Ion-Nav not removing pages from DOM on pop() #21831

Closed
@Gorshtak

Description

@Gorshtak

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:

  1. Click on header("Go to Second page") to open second ion-nav
  2. Click on "PUSH"
  3. 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

Screen Shot 2020-07-28 at 5 57 49 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions