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
fix: fix Affix placeholder height anomaly when chrome browser zoom is 80% #46823
fix: fix Affix placeholder height anomaly when chrome browser zoom is 80% #46823
Conversation
Signed-off-by: zhipenglin <sunandmoon001@163.com>
Run & review this pull request in StackBlitz Codeflow. |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit ff6e3a0:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #46823 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 722 722
Lines 12443 12443
Branches 3265 3265
=========================================
Hits 12443 12443 ☔ View full report in Codecov by Sentry. |
能提供个录屏看一下复现步骤吗?我这没复现出来 |
@MadCcc 看看? |
给一个可以复现的 codesandbox 吧,antd 官网 demo 无法按照你说的方法复现。 |
可以复现bug的例子项目地址:https://github.com/zhipenglin/affix-bug-example 复现步骤: |
[English Template / 英文模板]
🤔 这个变动的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
在使用Affix组件时,发现在chrome浏览器下缩放80%情况下,Affix内部的占位高度一直为0,缩放100%无此问题。
通过调试发现,在缩放为80%的情况下 placeholderRect.top为一个小数,例如:47.994789123535156,正常情况应该是48,导致getFixedTop函数计算结果异常。
通过增加Math.round方法消除这一结果
📝 更新日志
☑️ 请求合并前的自查清单