Skip to content

fix(react-router): allow swipe back over a splat container page - #31486

Closed
ShaneK wants to merge 1 commit into
fix/rr6-route-bugfrom
fix/rr6-root-splat-sibling
Closed

ShaneK wants to merge 1 commit into
fix/rr6-route-bugfrom
fix/rr6-root-splat-sibling

Conversation

@ShaneK

@ShaneK ShaneK commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Issue number: resolves #31479


What is the current behavior?

Currently, swipe-to-go-back does nothing over a splat container page in the root outlet. canStart decides whether the entering and leaving views are the same by comparing the entering view's resolved pathname against the current pathname, and a splat consumes whatever is left of the pathname, so its match always resolves to the whole current pathname. At the root that is every pathname, so the gesture is rejected before it starts.

What is the new behavior?

We now compare the view items directly, the same way onEnd a few lines below already does, so a container page sitting underneath a pushed sibling is no longer mistaken for the page being left. canStart also requires a leaving view now, because without one onStart reveals the entering page but never builds a progress animation, and core only calls onEnd when an animation exists, so the reveal was never undone and goBack never fired.

The pattern.path !== routeInfo.pathname condition came out with it. pattern.path is the declared route path, so it is either a wildcard or param pattern that can never equal a pathname, or a static path where the view comparison already rejects the gesture.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Stacked on #31481, which fixes the same issue for a splat one level down. This is the root outlet case, which that PR left open.

The reproduction needs its own React root. A root catch-all can't live in the shared route tree in App.tsx without swallowing every other spec's pathname, so the test index.tsx picks between App and RootSplatSiblingApp by pathname.

All five new tests fail on main and on #31481's branch alone, proving they cover the gap here.

Root splat sibling test page

@ShaneK
ShaneK added this pull request to stack #31487 September 25, 2026 14:01
@ShaneK
ShaneK requested a review from a team as a code owner September 25, 2026 14:01
@ShaneK
ShaneK requested review from thetaPC and removed request for a team September 25, 2026 14:01
@vercel

vercel Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
ionic-framework Ready Ready Preview Sep 25, 2026 3:14pm UTC

Request Review

@ShaneK
ShaneK force-pushed the fix/rr6-root-splat-sibling branch from f6f07d8 to a877abd Compare September 25, 2026 15:09
@ShaneK ShaneK closed this Sep 25, 2026
@ShaneK
ShaneK removed this pull request from stack #31487 September 25, 2026 15:54

This branch was successfully deployed

1 active deployment
Preview — a877abdc Deployed Sep 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: react @ionic/react package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: (react-router): lifecycle events do not fire on tab switches or routerDirection="none" navigation

1 participant