Skip to content

Draw Android ellipsis at an inline view in the text color - #60392

Open
lazerg wants to merge 2 commits into
react:mainfrom
lazerg:fix/issue-60391-ellipsis-color
Open

lazerg wants to merge 2 commits into
react:mainfrom
lazerg:fix/issue-60391-ellipsis-color

Conversation

@lazerg

@lazerg lazerg commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Summary:

When numberOfLines cuts a <Text> at an inline <View> on Android, the ellipsis is drawn black. The placeholder for the inline view has no color span, so Android draws its ellipsis with the layout's paint, and updateTextPaint sets that paint's size, typeface and letter spacing but never its color. It now sets the color from the base text attributes when one is set, and resetTextPaint puts it back to the default so a reused paint doesn't keep an old color.

Fixes #60391

Changelog:

[ANDROID] [FIXED] - Fix the ellipsis being drawn black when numberOfLines cuts a Text at an inline view

Test Plan:

Added a test in TextLayoutManagerFontWeightAdjustmentTest that checks updateTextPaint applies the base color and resetTextPaint clears it. The reporter confirmed on 0.89.0-rc.3 that setting the layout paint's color to the base text color makes the ellipsis match. I couldn't run the Android tests locally (no Android SDK on this machine), so I'm relying on CI.

@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 Nov 30, 2026
@github-actions github-actions Bot added the Meta Review Required This PR is considered risky and requires Meta to import it to do more testing before merging. label Nov 30, 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 Nov 30, 2026

@Abbondanzo Abbondanzo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is failing. Could you please also provide evidence of the fix working through before/after screenshots, recordings, etc? You should be running these tests locally and building RNTester to verify your changes are working

@lazerg

lazerg commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the test in 03d3f5c, it was passing color but fromReadableMap reads foregroundColor. I don't have an Android SDK or emulator set up right now so I can't build RNTester for screenshots yet, I'll add before/after ones once I can.

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

Visual regression

No visual differences at 03d3f5cc22bf.

ios: no capture

@lazerg

lazerg commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

The test passes now, and build_android and test_android_okhttp3 are green on 03d3f5c. I still can't build RNTester on this machine (no Android SDK or JDK), so I have no screenshots yet. I'll add before/after ones once I have a working setup.

This branch has not been deployed

No deployments
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. Meta Review Required This PR is considered risky and requires Meta to import it to do more testing before merging. 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] Ellipsis is drawn black when numberOfLines cuts a Text at an inline view (0.89 RC)

2 participants