-
-
Notifications
You must be signed in to change notification settings - Fork 234
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: offset四舍五入导致hiddenTabs计算逻辑错误 #667
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
src/TabNavList/index.tsx
Outdated
const { offsetWidth = 0, offsetHeight = 0 } = refObj.current || {}; | ||
return [offsetWidth, offsetHeight]; | ||
const { width = 0, height = 0 } = refObj?.current?.getBoundingClientRect() || {}; | ||
return [width, height]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…tabs into fix/offset_excute_error
Any update on this? |
如果tab内部没有scale,使用 getBoundingClientRect本身就是个错 出现这个的原因是这里 tabs/src/hooks/useVisibleRange.ts Line 41 in 2e015f6
floating numer的运算,导致本来想等的变大于了, 毕竟js
|
2023-07-07.14.19.32.mov
antd复现的Bug,相关issue: ant-design/ant-design#39079