Skip to content

Fix Android 15 text clipping with safe visual bounds measurement#57117

Open
TorinAsakura wants to merge 1 commit into
facebook:mainfrom
TorinAsakura:fix/android-15-text-clipping
Open

Fix Android 15 text clipping with safe visual bounds measurement#57117
TorinAsakura wants to merge 1 commit into
facebook:mainfrom
TorinAsakura:fix/android-15-text-clipping

Conversation

@TorinAsakura

@TorinAsakura TorinAsakura commented Jun 8, 2026

Copy link
Copy Markdown

Summary:

Fixes #56402.
Fixes #57110.

Android 15+ can clip text whose visual glyph bounds are wider than its advance-based desired width. The previous visual-bounds path fixed that by enabling setUseBoundsForWidth(true) on the final StaticLayout, but that path also changed final layout behavior and was later removed after multiline and wrapping regressions.

This keeps the final layout on the existing advance-based behavior, but uses an Android 15+ visual-bounds probe only when React Native needs to compute the desired width for AT_MOST or UNDEFINED measure modes. EXACTLY continues to use the width from Yoga directly. The desired width is never allowed to shrink below the old advance-based width.

Changelog:

[ANDROID] [FIXED] - Prevent Android 15+ text clipping without changing final StaticLayout bounds mode

Test Plan:

./gradlew :packages:react-native:ReactAndroid:testDebugUnitTest --tests com.facebook.react.views.text.TextLayoutManagerAbsoluteLayoutWithFractionalPixelTest -Preact.internal.useHermesStable=true
BUILD SUCCESSFUL
./gradlew :packages:react-native:ReactAndroid:ktfmtCheck -Preact.internal.useHermesStable=true
BUILD SUCCESSFUL

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 8, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Android] Parts of Text disappear due to incorrect Text rendering cut off on Android 15 & 16

1 participant