From 111d1e709e67c3ffaea5092eeb2599b9460d7ecd Mon Sep 17 00:00:00 2001 From: Bartlomiej Bloniarz Date: Mon, 5 Oct 2026 08:40:24 -0700 Subject: [PATCH] Take Text `ellipsizeMode` from the measured paragraph attributes on Android Summary: 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` Differential Revision: D123029564 --- .../com/facebook/react/views/text/ReactTextViewManager.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.kt index 6eaf70f6f24e..92d781317a8d 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.kt @@ -178,6 +178,13 @@ public constructor( else Float.NaN view.setMinimumFontScale(minimumFontScale) + view.setEllipsizeLocation( + TextAttributeProps.getEllipsizeMode( + paragraphAttributes.getString(TextLayoutManager.PA_KEY_ELLIPSIZE_MODE), + ), + ) + view.updateView() + // Clear any stale PreparedLayout from a previous update view.setPreparedLayout(null)