Skip to content

fix(vue-router): set pushedByRoute on same-tab push with direction none#31137

Merged
ShaneK merged 1 commit into
major-9.0from
FW-7145
May 12, 2026
Merged

fix(vue-router): set pushedByRoute on same-tab push with direction none#31137
ShaneK merged 1 commit into
major-9.0from
FW-7145

Conversation

@ShaneK

@ShaneK ShaneK commented May 12, 2026

Copy link
Copy Markdown
Member

Issue number: resolves #24074


What is the current behavior?

In vue-router, a router.push performed with routerDirection="none" doesn't set pushedByRoute on the resulting route info. The next page's ion-back-button then can't find a previous entry and falls back to defaultHref instead of going back through history.

The same bug was previously fixed for react-router in v6, this is the vue version of the fix (Angular doesn't need this fix because the router works very differently)

What is the new behavior?

createIonRouter now sets pushedByRoute from the leaving location when the navigation is routerAction === "push", routerDirection === "none", and stays within the same tab context. Cross-tab pushes with direction none still go through the existing tab-aware branch, which has different pushedByRoute semantics

After the fix, ion-back-button returns to the prior page through history and only falls back to defaultHref when there's genuinely no history to pop.

Does this introduce a breaking change?

  • Yes
  • No

Other information

New Playwright spec direction-none-back.spec.ts covers both the forward and none paths and asserts the back button lands on Page A, not the defaultHref fallback

Test Page

@ShaneK ShaneK requested a review from a team as a code owner May 12, 2026 13:02
@ShaneK ShaneK requested a review from BenOsodrac May 12, 2026 13:02
@vercel

vercel Bot commented May 12, 2026

Copy link
Copy Markdown

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 1:02pm

Request Review

@github-actions github-actions Bot added the package: vue @ionic/vue package label May 12, 2026

@thetaPC thetaPC left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@ShaneK ShaneK merged commit 9f69f50 into major-9.0 May 12, 2026
51 checks passed
@ShaneK ShaneK deleted the FW-7145 branch May 12, 2026 17:50
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