Skip to content

bug: navigation breaks when replacing nested tab view #30617

Closed
bokanechase-digistorm/ionic-framework
#1

Description

@bentleyo

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

When using nested routes and tabs there is a situation where navigation breaks when you replace a nested tab view with a sibling (and switching tabs between). When this happens the back button in the view doesn't work and you can't switch to the previous tab.

Expected Behavior

  • The back button should go to the Tab 1 view
  • Clicking on the Tab 2 tab should show the Tab 2 view

Steps to Reproduce

Steps to replicate bug:

  1. Go to: https://stackblitz.com/~/github.com/bentleyo/ionic-tabs-vue?file=src/views/Tab1Page.vue
  2. Open Tab 1 - Inner View 1
  3. Switch to Tab 2
  4. Switch back to Tab 1 (should still be on Inner View 1)
  5. Replace with Tab 1 - Inner View 2
  6. Try pressing the back button or switching to Tab 2, neither work

Code Reproduction URL

https://stackblitz.com/~/github.com/bentleyo/ionic-tabs-vue?file=src/views/Tab1Page.vue

Ionic Info

I am inside the ionic project directory, but it's playing up for me.

I can replicate using:

@ionic/core@8.7.2
@ionic/vue-router@8.7.2
@ionic/vue@8.7.2

[WARN] You are not in an Ionic project directory. Project context may be missing.

Ionic:

Ionic CLI : 5.4.16

Utility:

cordova-res : not installed
native-run : 2.0.1

System:

NodeJS : v18.16.0
npm : 9.5.1
OS : macOS Unknown

Additional Information

No response

Activity

  1. added a commit that references this issue on Apr 20, 2026
    dd751a3
  2. thetaPC commented on Oct 16, 2026

    @thetaPC
    Contributor

    Thanks for the report, and sorry for the delay.

    Verified on 9.0.8. useIonRouter().replace() is a root navigation: it is the same as ionRouter.navigate(path, 'root', 'replace'), which resets the navigation history so the new page becomes the start of the stack. View 2 therefore has nothing to go back to, but it still shows a back button, so tapping it does nothing. Switching to Tab 2 works on 9.0.8.

    Workaround, verified on 9.0.8: keep replace() and give the back button on the replacing page a default-href pointing at the page it should return to. With no history to go back to, the back button falls back to that route:

    <ion-buttons slot="start">
      <ion-back-button default-href="/tabs/tab1"></ion-back-button>
    </ion-buttons>

    We do not recommend switching to ionRouter.navigate(path, 'forward', 'replace') or Vue Router's router.replace() for this flow yet. They keep the history, but after a tab switch the back button changes the URL and leaves the replaced page on screen.

    Tracked as a bug in @ionic/vue-router.

  3. added a commit that references this issue on Oct 20, 2026
    86390f6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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