-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Scroll to anchor doesn't work under Chrome when smooth scrolling is disabled #2558
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Doesn't work on Safari too, even with smoothScroll set to true. |
#2566 doesn't seem to fix this issue, as I'm trying to fix the issue, but I have zero knowledge about vuepress, so it's problematic to even figure where to start looking for. Would really appreciate any advice. |
Following fixes the issue: naninovel/docs@7148c30 |
@elringus, thanks for sharing your solution! This will work only if you don't have much headers in your page. Otherwise, the core thread will stop the scroll in the middle of the page. To fix it you can set a small timeout:
Cheers! Edit: or even better:
|
This solution does not solve the issue completely with regards to accessibility. Although the element is scrolled into view, the focus is not set to the element. If the keyboard and or screen reader is being used to navigate the site, the focus will still be on the link, not the target. Chrome version 91.0.4472.114 - macOS Catalina 10.15.7. This is also true when clicking a "#some_target" link within the page itself - i.e. not just parachuting to the target from another page. |
Bug report
Steps to reproduce
Here is the source repo: https://github.com/Elringus/NaninovelWeb
UPDATE: I've fixed the issue in the repo with naninovel/docs@7148c30
What is expected?
Page scrolling to the specified anchor.
What is actually happening?
Page not scrolling to the specified anchor.
Other relevant information
Not reproducing with Firefox and Edge browsers.
Not reproducing when smooth scrolling is enabled.
npx vuepress info
in my VuePress project:Chrome (it's not displayed in the environment info for some reason): Version 84.0.4147.105 (Official Build) (64-bit)
The text was updated successfully, but these errors were encountered: