Vuepress: Scroll to anchor doesn't work under Chrome when smooth scrolling is disabled

Created on 6 Aug 2020  路  3Comments  路  Source: vuejs/vuepress




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




Bug report

Steps to reproduce

  1. Navigate to the following link using Chrome browser: https://naninovel.com/guide/integration-options.html#switching-modes
  2. Notice the page not scrolling to the specified anchor (even though the header is selected in sidebar).

Here is the source repo: https://github.com/Elringus/NaninovelWeb
UPDATE: I've fixed the issue in the repo with https://github.com/Elringus/NaninovelWeb/commit/7148c303e26dc7fc8d9fa6a89820778608a9b268

What is expected?

Page scrolling to the specified anchor.

What is actually happening?

Page not scrolling to the specified anchor.

Other relevant information

Not reproducing with Firefox and Edge browsers.
Not reproducing when smooth scrolling is enabled.

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

  System:
    OS: Windows 10 10.0.18363
    CPU: (16) x64 Intel(R) Core(TM) i7-6900K CPU @ 3.20GHz
  Binaries:
    Node: 10.15.3 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.15.2 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: 44.18362.449.0
  npmPackages:
    @vuepress/core:  1.5.2
    @vuepress/theme-default:  1.5.2
    vuepress: 1.5.2 => 1.5.2
  npmGlobalPackages:
    vuepress: Not Found

Chrome (it's not displayed in the environment info for some reason): Version 84.0.4147.105 (Official Build) (64-bit)

Most helpful comment

All 3 comments

Not reproducing with Firefox and Edge browsers.
Not reproducing when smooth scrolling is enabled.

Doesn't work on Safari too, even with smoothScroll set to true.

2566 doesn't seem to fix this issue, as scrollBehavior() function is not invoked at all when opening a page for the first time.

I'm trying to fix the issue, but I have zero knowledge about vuepress, so it's problematic to even figure where to start looking for. Would really appreciate any advice.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lileiseven picture lileiseven  路  3Comments

gaomd picture gaomd  路  3Comments

harryhorton picture harryhorton  路  3Comments

sankincn picture sankincn  路  3Comments

cfjedimaster picture cfjedimaster  路  3Comments