From c13e8a8fad5d45219f9eced1cba204b626bc217f Mon Sep 17 00:00:00 2001 From: Ana Margarida Silva Date: Thu, 4 May 2023 12:11:13 +0100 Subject: [PATCH] feat: improve comment and add example of the problem to rn-tester --- .../java/com/facebook/react/views/text/ReactTextView.java | 5 +++-- packages/rn-tester/js/examples/Text/TextExample.android.js | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java index 56a7f680d4383a..48f7fbcaafe377 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java @@ -391,8 +391,9 @@ public void setText(ReactTextUpdate update) { (int) Math.floor(paddingBottom)); } - // This is required to workaround the problem in Android where it - // can cut the ellipsis on cut text in certain font sizes and paddings + // Workaround for an issue where text can be cut off with an ellipsis when + // using certain font sizes and padding. Sets the provided text size + // (mFontSize) to ensure consistent rendering and prevent cut-off. if (!Float.isNaN(mFontSize)) { setTextSize(TypedValue.COMPLEX_UNIT_PX, mFontSize); } diff --git a/packages/rn-tester/js/examples/Text/TextExample.android.js b/packages/rn-tester/js/examples/Text/TextExample.android.js index 8234bde9a39088..018f1bd28b335f 100644 --- a/packages/rn-tester/js/examples/Text/TextExample.android.js +++ b/packages/rn-tester/js/examples/Text/TextExample.android.js @@ -676,6 +676,10 @@ class TextExample extends React.Component<{...}> { Maximum of one line no matter now much I write here. If I keep writing it{"'"}ll just truncate after one line + + Maximum of one line no matter now much I write here. If I keep + writing it{"'"}ll just truncate after one line + Maximum of two lines no matter now much I write here. If I keep writing it{"'"}ll just truncate after two lines