-
-
Notifications
You must be signed in to change notification settings - Fork 50.3k
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: Typography ellipsis not working in Table #32447
Conversation
Codecov Report
@@ Coverage Diff @@
## master #32447 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 414 414
Lines 7586 7589 +3
Branches 2132 2132
=========================================
+ Hits 7586 7589 +3
Continue to review full report at Codecov.
|
Size Change: +16 B (0%) Total Size: 920 kB
ℹ️ View Unchanged
|
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.
padding 计算问题
Math.floor(lineHeight) * (rows + 1) + | ||
const overflowRows = rows + 1; | ||
const oneRowMaxHeight = | ||
Math.floor(lineHeight) + | ||
pxToNumber(originStyle.paddingTop) + |
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.
oneRowMaxHeight 应当不包括 padding
const oneRowMaxHeight = Math.floor(lineHeight)
@@ -128,7 +129,9 @@ export default ( | |||
|
|||
// Check if ellipsis in measure div is height enough for content | |||
function inRange() { | |||
return Math.ceil(ellipsisContainer.getBoundingClientRect().height) < maxHeight; | |||
return ( | |||
Math.ceil(ellipsisContainer.getBoundingClientRect().height / overflowRows) < oneRowMaxHeight |
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.
pureHeight = ellipsisContainer.getBoundingClientRect().height -
pxToNumber(originStyle.paddingBottom) -
pxToNumber(originStyle.paddingBottom) -
pxToNumber(originStyle.borderTop) -
pxToNumber(originStyle.borderBottom)
Math.ceil(pureHeight / overflowRows) < oneRowMaxHeight
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
close #32432
💡 Background and solution
📝 Changelog
ellipsis
calculation bug when browser zoomed in.ellipsis
在 Chrome 下屏幕缩小时溢出的问题。☑️ Self Check before Merge