Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully 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 #29785
What is the current behavior?
Currently, with
createMemoryHistory, tapping the active tab from a child page leaves the child on screen. Memory history doesn't store a position inhistory.state, so the offsetresetTab()computes isNaNandrouter.go(NaN)goes nowhere. On 9.x it also throwsCannot read properties of undefined (reading '0').What is the new behavior?
When there's no position to traverse,
resetTab()now replaces the current entry with the tab'shref, the same fallback it already uses after a deep load. It uses the tab'shrefrather than the first route recorded for the tab, because after a deep load onto a child that first route is the child itself. Web and hash history always have a numeric position, so they're unaffected.Does this introduce a breaking change?
Other information
The new tests are in
memory.spec.ts, since the Vue test app uses web history and can't reproduce this. They cover resetting from a child page, resetting after a deep load onto a child, and replacing the child entry rather than pushing over it.