-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
Scroll to anchor in router.scrollBehavior
doesn't work
#213
Comments
router.scrollBehavior
doesn't work
@IssueHunt has funded $50.00 to this issue.
|
@egoist has rewarded $35.00 to @krmax44. See it on IssueHunt
|
Scrolling to First two triggered by clicking the heading anchor (not encoded and working), second two using browser back/forward (encoded and not working). We should put a saber/packages/saber/vue-renderer/app/router.js Lines 64 to 67 in 6118d78
|
@kidonng fixed in 0.6.7 |
Bug report
saber/packages/saber/vue-renderer/app/router.js
Lines 68 to 87 in 61992cb
The code attempts to scroll to the anchor if
to.hash
exists and the anchor can be found. But the scroll never happens.Version
0.6.4
Steps to reproduce
about.md
:hello.md
:# World Lorem ipsum...
Then click the link in
about.md
.What is expected?
Page scrolled to the title World.
What is actually happening?
Page scrolled to the top (default behavior).
Other relevant information
to.hash
only contains ASCII characters, the hash before and after escaping are the same. If it contains non-ASCII characters (e.g. CJK characters), escaping the hash will produce a selector matching nothing (assuming header'sid
is generated in standard behavior).document.querySelector(hash)
still matches nothing, thus the scroll won't trigger. Chances are page is not loaded at that time.saber -v
: cli.js/0.6.4 win32-x64 node-v12.3.1IssueHunt Summary
krmax44 has been rewarded.
Sponsors (Total: $50.00)
Tips
The text was updated successfully, but these errors were encountered: