Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
thetaPC
approved these changes
May 27, 2026
| test('should route when ion-router-link href contains a fragment', async ({ page }, testInfo) => { | ||
| testInfo.annotations.push({ | ||
| type: 'issue', | ||
| description: 'https://github.com/ionic-team/ionic-framework/issues/19365', |
Contributor
There was a problem hiding this comment.
Is this issue number correct? The PR description has 19566.
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 #19566
What is the current behavior?
Clicking an
ion-router-linkwhosehrefcontains a#fragment(e.g./catalog#pens) fails to navigate and logsnot part of the routing set.parsePathincore/src/components/router/utils/path.tsonly splits on?, so the fragment gets folded into the last path segment and no registered route matches. Even when navigation succeeds, the matching anchor is never scrolled into view.What is the new behavior?
parsePathextracts the fragment as a separate field, andwriteSegmentswrites it back onto the URL viapushState. Routes match against the path segments alone, so/catalog#pensresolves to the/catalogroute as expected.After
writeNavStateRootresolves, the router polls a few animation frames for an element matching the fragment inside the active page, then smooth-scrolls to it viaion-content.scrollToPoint, falling back toElement.scrollIntoViewwhen the target sits outsideion-content. AfragmentScrollTokencancels any in-flight scroll the moment a newersetSegmentsruns.Does this introduce a breaking change?
Other information
The fragment lookup scopes to the last
.ion-page:not(.ion-page-hidden)in the document. Nested outlets can have multiple non-hidden pages mounted at once, and an identically-named anchor on a parent page would otherwise win over the leaf the user is viewing.Preview pages: