vitest
vitest copied to clipboard
Docs website bug - resets scroll to top of page
Describe the bug
Frequently, and annoyingly, when I have opened a page in Vitest's website docs, after several seconds (usually just when I found what I was looking for), the page will spontaneously reset the scroll to the top of the page. The most recent time, I noticed something in the page URL; I was attempting to look at https://vitest.dev/config/#pool
, but the address when the scroll reset was https://vitest.dev/config/#pool-1-0-0
instead. This makes me think the issue is with something automatically parsing the heading and accidentally including the version number in the expected hash tag, which is incorrect.
Reproduction
Search google for something like "vitest pool". Click on the "Configuring Vitest" result. Scroll until you see "pool" in the right hand navigation, click it, start reading about pool configuration. Page often will reset to top.
Doesn't seem to be every time, so I don't know if I'm just hitting the pool link before something else has finished running, or what exactly the problem is.
System Info
This is browsing in Brave Version 1.62.165 Chromium: 121.0.6167.184 (Official Build) (x86_64). My development setup is not relevant to this issue.
Used Package Manager
npm
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guidelines.
- [X] Read the docs.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- [X] The provided reproduction is a minimal reproducible example of the bug.
We recently started to manually put #pool
instead of automatic #pool-1-0-0
as header id, so it's possible that we missed something and there are broken links left over.
- https://github.com/vitest-dev/vitest/pull/5239
If there is #pool-1-0-0
, then that's a wrong one, so it would be great if we can fix it, but I cannot find it from a quick look and cannot reproduce page scrolling back.
Maybe some temporary issue with cache or something?
I'm not sure. I've observed this behavior multiple times in the past couple months since our team resumed working on the project that has vitest in it, but I couldn't tell you when it started. It doesn't look like the links include the -1-0-0
part either, but like I said, it doesn't happen when I click the link; it happens 15-30 seconds later, just after I've scrolled a bit down from the anchor and found what I am looking for, typically 😂 I'll keep an eye out for anything consistent next time it happens or see if I can get any useful data from the page.
I just had this happen on https://vitest.dev/guide/mocking.html . I opened the page from a google search, did command-F to find "variable", 15 seconds later as I was trying to use the example to write my code the page reset scroll to the top. I did not click any links or anything else in the page. This was in Brave browser. Also none of the links are showing the number and hyphen suffix.
I tried to replicate the issue by closing the tab and opening the link again several times but was not able to do so.