- Notifications
You must be signed in to change notification settings - Fork10.5k
[release/10.0] Fix fetch request in data-enhance-nav="false" for same-page anchors#63915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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
lewing approved these changesOct 3, 2025
Member
lewing commentedOct 3, 2025
approved in email |
89f8531 intorelease/10.0 28 checks passed
Uh oh!
There was an error while loading.Please reload this page.
wtgodbe added a commit that referenced this pull requestOct 3, 2025
….0 (#63920)[release/10.0] Fix fetch request in data-enhance-nav="false" for same-page anchorsCo-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Labels
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.
Uh oh!
There was an error while loading.Please reload this page.
Backport of#63449 to release/10.0
/cc@ilonatommy@dariatiurina
Fix fetch request in data-enhance-nav="false" for same-page anchors
Fixes#55534.
Description
This pull request enhances the navigation logic to better handle hash-only changes in URLs, ensuring that navigation to anchors within the same page does not trigger a full page reload or unnecessary fetch requests. It introduces a utility function to detect hash-only changes and updates the navigation handler to leverage this, improving performance and user experience. Additional end-to-end tests and markup updates verify and demonstrate the new behavior.
Changes:
isHashOnlyChangeutility function inNavigationUtils.tsto detect when a navigation event only changes the hash fragment, avoiding unnecessary page loads.onPopStatehandler inNavigationEnhancement.tsto useisHashOnlyChange, preventing enhanced navigation logic from running when only the hash changes.EnhancedNavigationTest.csto verify that non-enhanced navigation to a hash does not trigger a page fetch, ensuring the scroll behavior works as expected without unnecessary network activity.Customer Impact
In the special cases for the same-page hash navigation without this bug fix the infinite cycle can occur. This prevents it. The fix is localized to the enhanced navigation.
Regression?
Risk
The fix is limited to same-page navigation on elements that have enhanced navigation explicitly disabled.
Verification
Packaging changes reviewed?