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

ynnelson picture ynnelson  路  3Comments

higuoxing picture higuoxing  路  3Comments

AleksejDix picture AleksejDix  路  3Comments

FadySamirSadek picture FadySamirSadek  路  3Comments

AMontagu picture AMontagu  路  3Comments