-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Initial load does not scroll to the heading referenced by the document hash #2428
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
Labels
priority: high
High priority issue
Comments
dcodeIO
added a commit
to AssemblyScript/website
that referenced
this issue
Jun 6, 2020
1 task
shouryaps
added a commit
to finbox-in/documentation
that referenced
this issue
Jun 21, 2020
dennisreimann
added a commit
to dennisreimann/btcpayserver-doc
that referenced
this issue
Jun 30, 2020
This fixes btcpayserver#614, which seems to be caused by vuejs/vuepress#2428.
Very good,However if I refresh it immediately, it will sometimes lead to inaccurate positioning. It is not clear whether it is caused by other plug-ins,I had to postpone exec it if (hash.length > 1) {
setTimeout(() => {
const id = decodeURIComponent(hash.substring(1));
const element = document.getElementById(id);
if (element) {
element.scrollIntoView();
}
}, 1000);
} |
The workaround does not seem to work when using router redirect: // .vuepress/enhanceApp.js
export default ({ router }) => {
router.addRoutes([
{ path: '/product/*', redirect: '/product/version/*' }
]);
} |
shouryaps
added a commit
to finbox-in/documentation
that referenced
this issue
Mar 20, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
Steps to reproduce
Right click and copy the link to a heading, obtaining a link to the page incl. the hash of the respective heading. Close the tab and open the just copied link in a new tab.
What is expected?
Initial load should scroll to the respective heading.
What is actually happening?
Initial load does not scroll to the respective heading.
Other relevant information
npx vuepress info
in my VuePress project:Environment Info:
Workaround
There's probably a better way, but this works for me: Eject
theme/layouts/Layout.vue
(or any other suitable component) from the default template, and addThe text was updated successfully, but these errors were encountered: