Skip to content

fix(vue-router): keep tab back button working after history rewrite#31134

Merged
ShaneK merged 2 commits into
major-9.0from
FW-6472
May 12, 2026
Merged

fix(vue-router): keep tab back button working after history rewrite#31134
ShaneK merged 2 commits into
major-9.0from
FW-6472

Conversation

@ShaneK
Copy link
Copy Markdown
Member

@ShaneK ShaneK commented May 11, 2026

Issue number: internal


What is the current behavior?

After the user navigates back in browser history and then pushes a new route, ion-back-button on a tab child page silently fails.

What is the new behavior?

When the computed history delta would be non-negative, fall back to router.replace on prevInfo.pathname (or to defaultHref if prevInfo has no pathname). incomingRouteParams was already set to a pop/back above, so the view stack still animates the transition as a back navigation, and the params are consumed by the resulting afterEach hook instead of leaking into the next navigation.

Does this introduce a breaking change?

  • Yes
  • No

Other information

@ShaneK ShaneK requested a review from a team as a code owner May 11, 2026 17:19
@ShaneK ShaneK requested a review from brandyscarney May 11, 2026 17:19
@vercel
Copy link
Copy Markdown

vercel Bot commented May 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ionic-framework Ready Ready Preview, Comment May 12, 2026 4:59pm

Request Review

@github-actions github-actions Bot added the package: vue @ionic/vue package label May 11, 2026
Copy link
Copy Markdown
Contributor

@thetaPC thetaPC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, with minor nits

Comment thread packages/vue-router/src/router.ts Outdated
Comment thread packages/vue/test/base/tests/e2e/playwright/tabs-back-button.spec.ts Outdated
Comment thread packages/vue/test/base/tests/e2e/playwright/tabs-back-button.spec.ts Outdated
Comment thread packages/vue/test/base/tests/e2e/playwright/tabs-back-button.spec.ts Outdated
Co-authored-by: Maria Hutt <[email protected]>
@ShaneK ShaneK merged commit 15e062b into major-9.0 May 12, 2026
94 of 96 checks passed
@ShaneK ShaneK deleted the FW-6472 branch May 12, 2026 17:14
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.

2 participants