Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] 页面跳转滚动条位置不变 #357

Closed
qingwave opened this issue Nov 20, 2021 · 2 comments
Closed

[BUG] 页面跳转滚动条位置不变 #357

qingwave opened this issue Nov 20, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@qingwave
Copy link

Describe the bug 描述你遇到的错误

每次页面跳转(首页->文章页,文章页->上一篇),跳转后滚动条不变,再滚动到最上面

Expected behavior 期待的行为

跳转后直接从页面顶端显示
不清楚是不是有意为之,在LoveIt上没发现这个问题,有点影响体验

Screenshots 屏幕截图

测试使用的是提供的demo https://hugodoit.pages.dev/zh-cn/
跳转前
image

跳转后,滚动条再滚动到顶端

Preview Environment 预览环境

  • DoIt: latest master
  • OS: Windows 10
  • Browser:Chrome

Additional Information 补充信息

@qingwave qingwave added the bug Something isn't working label Nov 20, 2021
@HEIGE-PCloud
Copy link
Owner

HEIGE-PCloud commented Nov 20, 2021

与 LoveIt 不同, DoIt 添加了 Pjax 刷新支持 #78,每次点击新的链接时,页面中只有变化的部分会被重新加载。因此页面的滚动位置需要重新定位至顶部。又由于 DoIt 设置了 smooth-scroll 的 CSS 属性,所以会显示滚动动画。

@qingwave
Copy link
Author

多谢解答

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants