Skip to content

Commit

Permalink
Merge pull request #2656 from DouyinFE/fix/typo-elipsis
Browse files Browse the repository at this point in the history
fix: Fixed the problem of JS omitting calculation error when display …
  • Loading branch information
DaiQiangReal authored Jan 2, 2025
2 parents f89e9d7 + 4c69ee9 commit 9486475
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/semi-ui/typography/util.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const getRenderText = (
ellipsisContainer.style.left = '0';
// 当 window.getComputedStyle 得到的 width 值为 auto 时,通过 getBoundingClientRect 得到准确宽度
// When the width value obtained by window.getComputedStyle is auto, get the exact width through getBoundingClientRect
if (originStyle.getPropertyValue('width') === 'auto') {
if (originStyle.getPropertyValue('width') === 'auto' && originEle.offsetWidth) {
ellipsisContainer.style.width = `${originEle.offsetWidth}px`;
}
ellipsisContainer.style.height = 'auto';
Expand Down

0 comments on commit 9486475

Please sign in to comment.