fix: skip-to-content scroll behavior#2401
Merged
sy-records merged 3 commits intodevelopfrom Apr 17, 2024
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
3 tasks
Member
|
Hi @jhildenbiddle , could plz more details on it? (Much thx that if you could provide a screenshot/recording) As per the early discuss and my understanding, thats what I did: On the |
Member
Author
|
@Koooooo-7 -- I've added descriptions and videos demonstrating the bug and the fix to PR summary (above). |
Koooooo-7
approved these changes
Apr 17, 2024
Member
Koooooo-7
left a comment
There was a problem hiding this comment.
LGTM, and nice experience improvement.
1 task
Merged
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.
Summary
Fixes an issue the new (unreleased) "Skip to Content" link that caused an immediate jump to to the content (instead scrolling) and the main content to scroll down (instead of being static) into place.
Example of bug (develop branch preview w/ Chrome 123)
The incorrect behavior is the result of three separate things occurring at the same time:
Example-Bug.mp4
Example of fix (PR changes w/ Chrome 123)
The fix if simple thanks to modern APIs: set the
preventScrolloption totruewhen calling the browser's nativefocus()method:Example-fix.mp4
Related issue, if any:
None
What kind of change does this PR introduce?
Bugfix
For any code change,
N/A
Does this PR introduce a breaking change?
No
Tested in the following browsers: