Skip to content

fix: correct RightFloatArea hiding behavior when scrolling back to top #3355

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

Merged
merged 2 commits into from
Apr 16, 2025

Conversation

LooseLi
Copy link
Contributor

@LooseLi LooseLi commented Apr 15, 2025

尽量按此模板PR内容,或粘贴相关的ISSUE链接。

已知问题

Fixes #3354

解决方案

  1. 修复闭包问题,确保滚动监听函数能访问最新状态
  2. 改进滚动百分比计算逻辑,使用正确的视口高度
  3. 添加完整的边界情况处理,避免计算错误
  4. 使用 requestAnimationFrame 优化滚动事件处理性能

改动收益

  • 组件行为更加符合预期,回到顶部时自动隐藏
  • 使用 requestAnimationFrame 与浏览器渲染周期同步,提高流畅度
  • 完整处理边界情况,避免计算错误

具体改动

/themes/hexo/components/RightFloatArea.js

测试确认

  • 本地开发环境测试通过
  • 生产环境构建测试通过
  • 版本号正确显示
  • 环境变量配置正常工作

Copy link

vercel bot commented Apr 15, 2025

@LooseLi is attempting to deploy a commit to the tangly1024's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Owner

@tangly1024 tangly1024 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

精彩!

@tangly1024 tangly1024 merged commit b9738d2 into tangly1024:main Apr 16, 2025
3 of 6 checks passed
@LooseLi LooseLi deleted the fix-hexo-right-float-area branch April 17, 2025 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hexo 主题中 RightFloatArea 组件回到页面顶部后不会隐藏
2 participants