Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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 #29413
What is the current behavior?
In
viewStacks.ts,unmountLeavingViewsandmountIntermediaryViewswalk the outlet's view stack usingstartIndex - delta(orstartIndex + delta) as the loop end, with no bound onviewStack.length.deltacomes from the popstate event's history delta. Apps that mount<ion-tabs>at the root with no outer<ion-router-outlet>only have one outlet registered, sousingLinearNavigationis true and these helpers actually run. Each tab switch adds a browser history entry but reuses existing view items, so|delta|can easily exceed the stack depth above the entering view. The loop then readsviewStack[i]asundefinedand throwsTypeError: viewItem is undefinedfromviewItem.mount = false. The navigation aborts mid-transition, which is what surfaces the secondaryenteringEl is undefinedwarning and leaves that route stuckWhat is the new behavior?
Both helpers bail when the entering view item isn't in the stack (
startIndex === -1) and clamp the loop end toMath.min(viewStack.length, ...), so a delta that overruns the stack stops at the last real view item instead of indexing past the end. A new Vitest spec atpackages/vue/test/base/tests/unit/tabs-single-outlet.spec.tsmounts<ion-tabs>as the app root with flat routes, builds up history across tabs and sub-pages, then callsrouter.go(-6). Without the fix the spec catches the unhandledTypeErrorfromviewStacks.tsDoes this introduce a breaking change?
Other information