Vuepress: Markdown [[toc]] requires two clicks to go to page anchor

Created on 16 Jul 2020  路  1Comment  路  Source: vuejs/vuepress




  • [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

Most helpful comment

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.

>All comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ulivz picture ulivz  路  18Comments

chuckdries picture chuckdries  路  90Comments

mrleblanc101 picture mrleblanc101  路  18Comments

tohagan picture tohagan  路  60Comments

koskimas picture koskimas  路  18Comments