react-native-web icon indicating copy to clipboard operation
react-native-web copied to clipboard

ellipsizeMode on Text component does not work

Open aalises opened this issue 5 years ago • 3 comments

The problem ellipsizeMode on Text component does not work. the produced css is always text-overflow: ellipsis regardless of the value of the ellipsizeMode e.g ellipsizeMode: "clip".

How to reproduce

Example: https://codesandbox.io/embed/mo1ylwmp08

Steps to reproduce:

  1. Create a clipped text with ellipsizeMode different than tail
<Text numberOfLines={1} ellipsizeMode="clip" > Example Text </Text>
  1. The text is always clipped with ellipsis regardless of the mode (head, clip...)

Expected behavior ellipsizeMode = "clip" generates text-overflow: clip, for example, and not text-overflow: ellipsis ...

Environment (include versions). Did this work in previous versions?

  • React Native for Web (version): 0.11.x
  • React (version): 16.8.4
  • Browser: Google Chrome

aalises avatar May 03 '19 09:05 aalises

Somewhat related to this... ellipsizeMode: middle will also not work as expected on web platforms as there is no CSS equivalent to cropping text in the middle.

marcaaron avatar Jan 03 '22 18:01 marcaaron

override it with <Text ellipsizeMode='clip' color={'grey300'} style={{textOverflow:"clip"}} numberOfLines={1}>

Bournegit avatar Feb 26 '23 13:02 Bournegit