Skip to content

fix(vue-router): hide back button on reset tab root - #31653

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

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

Conversation

@michaelkhabarov

Copy link
Copy Markdown

What is the current behavior?

Tapping the active tab button resets the tab with router.go(), which leaves the tab's child as the last route in the tab stack. When the user then switches to another tab and back, the router copies pushedByRoute from that child onto the tab root, so the root page gets can-go-back and shows a back button with nowhere sensible to go.

  1. Open /tabs/tab1 and navigate to a child page.
  2. Tap the Tab 1 button to return to /tabs/tab1.
  3. Tap the Tab 2 button.
  4. Tap the Tab 1 button. /tabs/tab1 now shows a back button (visible when the button has no defaultHref).

What is the new behavior?

  • pushedByRoute is copied only when the last route in the tab stack is the page the tab returns to, so a reset tab root no longer shows a back button.
  • Added a Playwright test to tabs.spec.ts that follows the steps above. Without the fix it fails on the tab1 root having ion-page can-go-back.

Does this introduce a breaking change?

  • Yes
  • No

Tapping the active tab resets it with router.go(), which leaves the
tab's child as the last route in its stack. Switching to another tab
and back then copied the child's pushedByRoute onto the tab root, so
the root showed a back button.

Copy pushedByRoute only when the last route in the stack is the page
the tab returns to.

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:39
@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