fix: Fixed the problem of JS omitting calculation error when display … #2656
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…is none
中文模板 / Chinese Template
What kind of change does this PR introduce? (check at least one)
PR description
Fixes #
在 #2591 问题修复中,为了获取到 width 为 auto 的容器的实际高度,使用了 offsetWidth,但是当 display 为 none 时候,offsetWidth 将为 0,会导致 JS 缩略计算错误。
复现版本 2.72.0。复现代码
上述问题我们通常是建议用户使用 tabs 的 keepDOM={false} 来保证正确性。
在#2591 修改之前 ,表现是虽然无法计算出合理的截断,会显示更多行的数据内容。在#2591 修改之后,会出现只显示...的情况。因此在 width 为auto 的情况下,此次的修改为仅当 offsetWidth 非0 时候,才会将 offsetWidth 作为计算缩略的容器的 width 值。
Changelog
🇨🇳 Chinese
🇺🇸 English
Checklist
Other
Additional information