Closed declanchiu closed 1 week ago
I can't reproduce.
I can't reproduce. 我无法重现。
Thanks for trying to reproduce it, but the way I see it in the gif is a bit different, the correct way to do it is to click on an anchor and then scroll away from the current anchor, for example after clicking on the last anchor, the url is spliced with the anchor, then scroll to the top of the page, then refresh the page and you can see that the url with the anchor doesn't scroll to the bottom after refreshing! The
Thanks. From your gif, I see two main issues you want to point it out.
Differences from VitePress
label in aside component, the highlighted label is Try Rspress
. This is the expected behavior because it has reached the bottom of the page and the content of the two labels fills the screen, so the last label Try Rspress
is highlighted. You can try it at https://vitepress.dev/reference/runtime-api#frontmatter, and the same behaviour when in this scene.This bug is caused by extra setActiveLink()
which is implemented to fix right aside nav item doesn't highlight automatically while opening in a new tab in #319
We need to deal both same page refresh and open new tab well.
版本信息
问题详情
After memorizing an anchor point, why doesn't it jump to the specific anchor point after refreshing, and why is the right side highlighted in the wrong place?
复现链接
https://rspress.dev/guide/advanced/custom-search#aftersearch
复现步骤
Click on one of the document's anchor points
The current url records the anchor.
Refresh the page according to the current url
Finds the problem mentioned above