You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java
+10-2Lines changed: 10 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -512,7 +512,9 @@ public static long measureText(
512
512
// incorrect
513
513
// values when the paragraph is RTL and `setSingleLine(true)`.
514
514
? calculatedWidth - lineWidth
515
-
: layout.getLineRight(line) - placeholderWidth;
515
+
// add a check that text is single line (not only 1 line, but forced to
516
+
// singleline)
517
+
: layout.getEllipsizedWidth() - placeholderWidth;
516
518
} else {
517
519
// The direction of the paragraph may not be exactly the direction the string is
518
520
// heading
@@ -544,7 +546,13 @@ public static long measureText(
544
546
}
545
547
}
546
548
// Vertically align the inline view to the baseline of the line of text.
0 commit comments