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

fix(Text): Support ellipsizeMode="clip"

Open evancharlton opened this issue 3 years ago • 1 comments

The Text component supports different options for ellipsizeMode, rather than assuming a trailing-edge '...'.

This change adds support for ellipsizeMode="clip" -- but only in one special case: numberOfLines={1}. This is because that's all that is supported by the browser vendors at the moment, so it's the best that can be done by pure CSS.

Additionally, ths expands the handling of numerOfLines to accommodate the value 0, as react-native specifies that a value of 0 is the same as not specifying anything.

evancharlton avatar Jan 10 '22 14:01 evancharlton

I realize that this fixes two bugs in one change; I'm more than happy to split them into separate PRs if you'd prefer :)

evancharlton avatar Jan 10 '22 14:01 evancharlton

Going to close this because a number of changes have been made since this PR. Feel free to create a new PR on top of master. Thanks

necolas avatar Mar 28 '23 23:03 necolas