Skip to content

Markdown [[toc]] requires two clicks to go to page anchor #2489

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

Open
staghouse opened this issue Jul 16, 2020 · 2 comments
Open

Markdown [[toc]] requires two clicks to go to page anchor #2489

staghouse opened this issue Jul 16, 2020 · 2 comments

Comments

@staghouse
Copy link

  • [X ] I confirm that this is an issue rather than a question.

Bug report

Steps to reproduce

Create a MD page add headers. Then add [[toc]] above them.

What is expected?

The table of contents should render and the links should anchor to the appropriate headers on a single click

What is actually happening?

Two clicks are being required. The URL gets updated with the hash but nothing happens until you click again. This behavior is also happening within the documentation here.

Other relevant information

  • Output of npx vuepress info in my VuePress project:
Environment Info:

  System:
    OS: macOS 10.15.4
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Binaries:
    Node: 12.18.2 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.5 - /usr/local/bin/npm
  Browsers:
    Chrome: 84.0.4147.89
    Edge: Not Found
    Firefox: 78.0.2
    Safari: 13.1
  npmPackages:
    @vuepress/core:  1.4.1 
    @vuepress/theme-default:  1.4.1 
    vuepress: ^1.4.1 => 1.4.1 
  npmGlobalPackages:
    vuepress: Not Found
@elringus
Copy link

elringus commented Jul 17, 2020

Not sure if related, but if smooth scrolling is disabled, anchors doesn't work at all when navigating via URL.

Eg, try navigating this URL: https://naninovel.com/guide/integration-options.html#switching-modes The page won't scroll to the specified anchor.

Reproduced with VuePress v1.5.2 on Chrome; Firefox works fine.

@staghouse
Copy link
Author

Confirming this seems to resolve if smooth scrolling is disabled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants