Cannot move to another page's anchor
See original GitHub issue🐛 Bug Report
Cannot move to another page’s anchor when clicking the link.
Have you read the Contributing Guidelines on issues?
yes
To Reproduce
- Add a page named “doc1” with the following contents
## foo
here require large contents enough to scroll
...
...
...
...
...
## bar
some contents
- Add a page named “doc2” with the following contents
[link to another page's anchor](doc1#bar)
- Build the pages and open the browser
- Click the link at the page “doc2”
Expected behavior
Move to the “bar” on the page “doc1”
Actual Behavior
Just move to the page “doc1”, but the scroll position is incorrect (=top).
Your Environment
- Docusaurus version used: ^2.0.0-alpha.55
- Environment name and version (e.g. Chrome 83.0.4103.97, Node.js 12.14.0):
- Operating system and version (desktop):
Reproducible Demo
https://shinout.github.io/docusaurus-incorrect-anchor-move-repro/docs
- Click the link
doc1#Images
at Document Number 2(doc2)
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (8 by maintainers)
Top Results From Across the Web
Navigate to an anchor on another page - Stack Overflow
Yes I'm using that one, I have multiple pages all with the same nag so when sections aren't on the same page I...
Read more >Going to anchor across pages - WordPress.org
The problem is that going to an anchor in another page now first hits that anchor, in all the tested cases, but then...
Read more >Insert and manage anchor links - HubSpot Knowledge Base
Learn how to create an anchor link to help your visitors navigate to a specific section of your content without scrolling.
Read more >Following a link to an anchor within another page doesn't ...
should open the page and scroll to the anchor, but it's currently not scrolling. Environment. Confluence Cloud. Steps to Reproduce. Create a page;;...
Read more >Anchor links: do's and don'ts - AGConsult
Anchor links, also called jump links or in-page links, are links that lead to another part of the page. If someone clicks on...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh that’s great! Look @JoelMarcey I hired a fellow without knowing 🎉
I’ve made a repro for the issue mentioned by @shinout
To Reproduce:
It goes to the start of the page instead of the actual header
Reproducible Demo: Repo: https://github.com/teikjun/docusaurus-anchor-repro