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
Root cause is a bug in React Native for Android (iOS works correctly). When userSelect:'auto' or selectable={true} is used in combination with numberOfLines on a React Native Text, Android clips overflow text rather than using the default ellipsizeMode:'tail'.
The workaround to restore the text overflow ellipsis is to set userSelect:'none' on the text for Android, which comes at the cost of text no longer being selectable.
Expected behavior
Text should be truncated with an ellipsis and remain user-selectable.
Describe the issue
Root cause is a bug in React Native for Android (iOS works correctly). When
userSelect:'auto'
orselectable={true}
is used in combination withnumberOfLines
on a React NativeText
, Android clips overflow text rather than using the defaultellipsizeMode:'tail'
.The workaround to restore the text overflow ellipsis is to set
userSelect:'none'
on the text for Android, which comes at the cost of text no longer being selectable.Expected behavior
Text should be truncated with an ellipsis and remain user-selectable.
Steps to reproduce
React Native 0.75 or below. Android.
<html.span>
lineClamp
Test case
https://snack.expo.dev/rIIwaSlqQ6cHKlcO2Vatn?platform=android
Additional comments
Android hack to fix this https://stackoverflow.com/questions/14691511/textview-using-spannable-ellipsize-doesnt-work/40505388#40505388
The text was updated successfully, but these errors were encountered: