Repository navigation
Commit 8cd9b76
Take Text
Summary:
Pull Request resolved: #58865
On Android, `ReactTextView` measured text with the paragraph attributes from its state, but drew the ellipsis from a separate `ellipsizeMode` view prop that starts as `tail`. The paragraph attributes default `ellipsizeMode` to `clip`. When a view is created with props that omit values equal to their defaults, an explicit `ellipsizeMode="clip"` never reached the view prop, so text with `numberOfLines` was truncated with an ellipsis instead of being clipped.
`ReactTextView` now takes the ellipsis from the same paragraph attributes it is measured with, like `minimumFontSize` and `textBreakStrategy`, so a single source of truth decides it, as on iOS.
Changelog: [Android][Fixed] - Fix `ellipsizeMode="clip"` being ignored on newly created `Text`
Reviewed By: christophpurrer
Differential Revision: D123029564
fbshipit-source-id: 9f587f172d7586b3b747f5113a8e6f94d0ceeeb4ellipsizeMode from the measured paragraph attributes on Android (#58865)1 parent 98d6795 commit 8cd9b76
1 file changed
Lines changed: 7 additions & 0 deletions
File tree
- packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
181 | 188 | | |
182 | 189 | | |
183 | 190 | | |
| |||
0 commit comments