Skip to content

Commit

Permalink
feat: improve comment and add example of the problem to rn-tester
Browse files Browse the repository at this point in the history
  • Loading branch information
BeeMargarida committed May 4, 2023
1 parent aaa65e1 commit c13e8a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 4 additions & 0 deletions packages/rn-tester/js/examples/Text/TextExample.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
</Text>
<Text style={{fontSize: 31}} numberOfLines={1}>
Maximum of one line no matter now much I write here. If I keep
writing it{"'"}ll just truncate after one line
</Text>
<Text numberOfLines={2} style={{marginTop: 20}}>
Maximum of two lines no matter now much I write here. If I keep
writing it{"'"}ll just truncate after two lines
Expand Down

0 comments on commit c13e8a8

Please sign in to comment.