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: record the completed length of the last calculation as the transison length #43058
Conversation
ci 挂了 |
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #43058 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 665 665
Lines 11276 11280 +4
Branches 3048 3049 +1
=========================================
+ Hits 11276 11280 +4
☔ View full report in Codecov by Sentry. |
@MadCcc 看看 |
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.
bba0531
to
4893325
Compare
…tion width in the calculation
4893325
to
6fe22c5
Compare
5b53a54
to
a974bc0
Compare
|
||
it('should not throw default dom nodes', async () => { | ||
let currentWidth = 100; | ||
// string conut is different with different width |
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.
typo: count
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
fix #42958
💡 Background and solution
The bug is caused by below codes:
if (!enabledMeasure || walkingState !== DONE_WITH_ELLIPSIS) {
return children(nodeList, false);
}
when ellipsis is walking, will use all the nodelist as temporary text, this caused space is not enough, so page scroll bar will show up
solution is record the completed length of the last calculation as the transition length in the calculation
📝 Changelog
☑️ Self-Check before Merge
🚀 Summary
🤖 Generated by Copilot at 741a1de
Improve ellipsis feature in
Typography
component by reusing optimal text length. RefactorEllipsis.tsx
to use a state variablelastLen
.🔍 Walkthrough
🤖 Generated by Copilot at 741a1de
lastLen
to store the last length of the text that was successfully rendered with ellipsis (link, link)lastLen
as a temporary width for the text if it exists, to avoid rendering the text with the full length and then shrinking it, which could cause unnecessary layout shifts and performance issues (link)