Skip to content

fix(vue): guard late swipe cancellation - #31515

Open
dandoingdev wants to merge 1 commit into
ionic-team:mainfrom
dandoingdev:codex/vue-swipe-cancel-missing-page
Open

dandoingdev wants to merge 1 commit into
ionic-team:mainfrom
dandoingdev:codex/vue-swipe-cancel-missing-page

Conversation

@dandoingdev

Copy link
Copy Markdown

Issue number: resolves #31514


What is the current behavior?

A cancelled swipe's animation callback can run after navigation has changed. IonRouterOutlet looks up the previous view from the current route and immediately accesses enteringViewItem.ionPageElement. If the view is missing, or its page has been unmounted, cancellation throws a TypeError.

A deterministic reproduction using the real router and outlet is included in the issue: reproduction app. It models a late callback explicitly rather than relying on physical gesture timing. The failure was confirmed in Chrome with the published 9.0.6 packages.

What is the new behavior?

  • Return from cancellation cleanup when there is no previous mounted page to hide.
  • Preserve the existing aria-hidden and ion-page-hidden cleanup when the page exists, and the completed-swipe navigation behavior.
  • Add five regression cases, including late cancellation after returning to the root with the real Ionic router.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Validation:

  • The missing-view and unmounted-page tests fail against the unpatched main-branch bundle with the expected TypeErrors.
  • vitest run tests/unit/swipe-cancel.spec.ts tests/unit/router-outlet.spec.ts: 7 tests pass against the locally built patched Vue package.
  • npm run typecheck, npm run eslint, and Prettier check for IonRouterOutlet.ts pass in packages/vue.
  • npm run bundle passes in packages/vue.

This changes only the cancellation cleanup branch. It does not change navigation semantics or disable swipe gestures.

@dandoingdev
dandoingdev requested a review from a team as a code owner October 1, 2026 15:32
@dandoingdev
dandoingdev requested a review from ShaneK October 1, 2026 15:32
@vercel

vercel Bot commented Oct 1, 2026

Copy link
Copy Markdown

@dandoingdev 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 1, 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.

bug: vue swipe cancellation throws when the previous page is missing

1 participant