Closed jhildenbiddle closed 5 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
docsify-preview | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 17, 2024 5:57am |
Hi @jhildenbiddle , could plz more details on it? (Much thx that if you could provide a screenshot/recording)
sorry, that I don't full understand the behaviors.
As per the early discuss and my understanding, thats what I did: I open 2 preview, with and without this fix.
On the preview
site, press Tab
, click the Skip to content
is fine.
Then, I tabs Tab
multi times, and click or switch sections.
@Koooooo-7 --
I've added descriptions and videos demonstrating the bug and the fix to PR summary (above).
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:
https://github.com/docsifyjs/docsify/assets/442527/7205bd0e-598e-4e9f-97d6-11d586cad434
Example of fix (PR changes w/ Chrome 123)
The fix if simple thanks to modern APIs: set the
preventScroll
option totrue
when calling the browser's nativefocus()
method:https://github.com/docsifyjs/docsify/assets/442527/9509967b-40e1-469f-9cb5-e6b64e6c3f1e
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: