Skip to content

fix(vue-router): honor caller-provided direction on replace navigation#31142

Merged
ShaneK merged 1 commit into
major-9.0from
FW-6961
May 15, 2026
Merged

fix(vue-router): honor caller-provided direction on replace navigation#31142
ShaneK merged 1 commit into
major-9.0from
FW-6961

Conversation

@ShaneK
Copy link
Copy Markdown
Member

@ShaneK ShaneK commented May 13, 2026

Issue number: resolves #24995


What is the current behavior?

In createIonRouter, the replace-action branch resolves routeInfo.routerDirection and routeInfo.routerAnimation by preferring the leaving route's values over the ones the caller passed in. The leaving route wins whenever it has any value set, so useIonRouter.navigate(url, 'forward', 'replace') called after a back navigation ends up with routerDirection: 'back', and the same call from the initial route ends up with 'none'. The caller's explicit direction is silently discarded.

What is the new behavior?

The precedence is flipped: the caller's routerDirection and routerAnimation are kept, and the leaving route's values are only used as a fallback when nothing was provided. forward + replace now animates forward regardless of how the user got to the leaving page, and the default useIonRouter.replace(url) keeps the 'root' direction it was constructed with instead of inheriting whatever the leaving route had recorded.

Does this introduce a breaking change?

  • Yes
  • No

Other information

@ShaneK ShaneK requested a review from a team as a code owner May 13, 2026 13:49
@ShaneK ShaneK requested a review from brandyscarney May 13, 2026 13:49
@vercel
Copy link
Copy Markdown

vercel Bot commented May 13, 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 13, 2026 1:49pm

Request Review

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

@OS-jacobbell OS-jacobbell left a comment

Choose a reason for hiding this comment

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

Makes sense, good find!

@ShaneK ShaneK merged commit 612ff06 into major-9.0 May 15, 2026
50 checks passed
@ShaneK ShaneK deleted the FW-6961 branch May 15, 2026 15: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