Repository navigation
fix(vue): skip transitions for superseded pages - #31570
Open
hendriksenremco wants to merge 1 commit into
Open
hendriksenremco wants to merge 1 commit into
hendriksenremco wants to merge 1 commit into
Conversation
A page that mounted its ion-page after the route had moved on to a newer page ran the transition for that newer page. The newer page had no ion-page yet, so the transition threw a TypeError. Only run the transition from the register callback when the view item for the current route is the entering item, or when that item has no pending register callback. The newer page runs its own transition once it registers. closes ionic-team#31569 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@hendriksenremco is attempting to deploy a commit to the Ionic Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue number: resolves #31569
What is the current behavior?
When a page in
IonRouterOutletmounts its<ion-page>after the route has already moved on to a newer page, itsregisterCallbackstill callshandlePageTransition(). That function reads the current route, so it runs the transition for the newer page, which has noion-pageyet. This logs the missing<ion-page>warning and throwsTypeError: Cannot read properties of undefined (reading 'classList')inisViewVisible.What is the new behavior?
registerCallbacklooks up the view item for the current route first. It only runs the transition when that item is the entering item, or when that item has no pendingregisterCallback.ion-pageregisters.routing.spec.ts: two async pages, navigating to both before either loads, and loading the first one before the second.Does this introduce a breaking change?
Other information
Testing:
packages/vue:npm run lint,npm run typecheckandnpm run buildpass, with no diff after lint.vue3),npm run test:unit: 74 tests pass. The new test fails without the fix with theTypeErrorabove.IonRouterOutlet) via a local yarn patch on@ionic/vue8.8.5.This PR was written with Claude Code.
🤖 Generated with Claude Code