-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
Markdown Header Anchor Links do not work on page load #2399
Comments
Is there a similar bug on the builded website? This should be relevant only in development mode. |
No there is no similar bug in prod. It only affects development mode. |
In dev mode, we do not use SSR, so this issue occurs. I do not think this is a serious bug, since there is no such thing in the production build. This may not be very comfortable, although it is unlikely that you will often use anchors links in dev mode 🤷♂️. |
Should we just close this issue then? Seems very minor if it only affects dev mode. |
I have this bug even after building. Any workaround (other than refreshing, which effectively works)? |
Edit: |
I found a cross-page anchor link that is working on the current Docusaurus site. See the “multi-instance plugins” link under https://docusaurus.io/docs/blog#multiple-blogs. |
Still have this problem, latest version |
@k8w, me too. You might want to follow issue 3081. It explains the problem, although no solution has been given yet. |
🐛 Bug Report
Each markdown header has a targeted anchor link which corresponds to a URL.
i.e. http:///docs/mobile/doc1#header1
If you click on the headers in the right sidebar when the documentation is loaded, the page scrolls to the header that is the anchor link target as expected.
But, if you copy a link to one of the headers with a anchor
#
in it, and paste it into a new tab, the page does not scroll to the appropriate header on page load.Have you read the Contributing Guidelines on issues?
yes
To Reproduce
yarn start
Expected behavior
The page
doc1
is opened and scrolled to the admonitions headerActual Behavior
The page
doc1
is opened but not scrolled to the admonitions headerYour Environment
"@docusaurus/core": "^2.0.0-alpha.48",
"@docusaurus/preset-classic": "^2.0.0-alpha.48",
Reproducible Demo
This repo is an unmodified
npx @docusaurus/init@next init test-site classic
but including for completenesshttps://github.com/Noah-Silvera/docusaurus-anchor-links-bug
The text was updated successfully, but these errors were encountered: