Skip to content

fix(vue-router): reset tab after other tab reset - #31654

Open
michaelkhabarov wants to merge 1 commit into
ionic-team:mainfrom
michaelkhabarov:fix/vue-router-tab-reset-dropped-root
Open

michaelkhabarov wants to merge 1 commit into
ionic-team:mainfrom
michaelkhabarov:fix/vue-router-tab-reset-dropped-root

Conversation

@michaelkhabarov

Copy link
Copy Markdown

What is the current behavior?

Tapping the active tab button resets the tab with router.go(). When another tab is reset this way and the user then switches to a tab whose child page is restored, that push drops the browser history entry of the tab root. The first route in the tab stack is now ahead of the current history position, so tapping the tab button again calls router.go() with a positive delta and nothing happens.

  1. Open /tabs/tab1 and navigate to a child page.
  2. Tap the Tab 2 button and navigate to a child page.
  3. Tap the Tab 1 button (the tab1 child is restored), then tap it again to return to /tabs/tab1.
  4. Tap the Tab 2 button (the tab2 child is restored).
  5. Tap the Tab 2 button again. It stays on the child page instead of going to /tabs/tab2.

What is the new behavior?

  • When the first route of the tab stack is ahead of the current history position, the tab button replaces the current entry with the tab root, the same way it already does when the first route is the current entry.
  • Added a Playwright test to tabs.spec.ts that follows the steps above. Without the fix it fails because the tab2 root stays hidden.

Does this introduce a breaking change?

  • Yes
  • No

Tapping the active tab resets it with router.go(). When another route
is pushed after that, the browser drops every history entry after it,
including the root of a tab whose child is pushed next. The first
entry of that tab's stack is then ahead of the current position, so
tapping the tab button called router.go() with a positive delta and
nothing happened.

Replace the current entry with the tab root in that case, as the tab
already does when its first entry is the current one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michaelkhabarov
michaelkhabarov requested a review from a team as a code owner October 24, 2026 19:41
@vercel

vercel Bot commented Oct 24, 2026

Copy link
Copy Markdown

@michaelkhabarov is attempting to deploy a commit to the Ionic Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the package: vue @ionic/vue package label Oct 24, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: vue @ionic/vue package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant