question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

  1. Add a page named “doc1” with the following contents
## foo
here require large contents enough to scroll
 ...
 ...
 ...
 ...
 ...

## bar
some contents
  1. Add a page named “doc2” with the following contents
  [link to another page's anchor](doc1#bar)
  1. Build the pages and open the browser
  2. 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:closed
  • Created 3 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
yangshuncommented, Jun 9, 2020

Oh that’s great! Look @JoelMarcey I hired a fellow without knowing 🎉

2reactions
teikjuncommented, Jun 9, 2020

I’ve made a repro for the issue mentioned by @shinout

To Reproduce:

  1. Visit https://docusaurus-anchor-repro.now.sh/docs/doc2
  2. Click “go to a header written in japanese” link

It goes to the start of the page instead of the actual header

Reproducible Demo: Repo: https://github.com/teikjun/docusaurus-anchor-repro

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found