Skip to content

[Android] Ellipsis is drawn black when numberOfLines cuts a Text at an inline view (0.89 RC) #60391

Backlog

Description

@coldsmirk

Description

When numberOfLines cuts a <Text> at an inline <View> on Android, the ellipsis is drawn black instead of in the text's color. On a dark background it can be almost invisible. I see it on 0.89.0-rc.3 and on main (0.90.0-nightly-20261130-868828f0d).

The black comes with enablePreparedTextLayout, which is on by default since #59152. In dark mode, 0.88.1 draws the same ellipsis light grey, and so does 0.89.0-rc.3 with the flag off (I only ran that one at a font scale of 1.3). That isn't the text's color either, but it can be read.

From the source: an inline view's placeholder has no text style, so the ellipsis that stands for it is drawn with the layout's paint. TextLayoutManager.newPaintWithAttributes makes a new TextPaint, which is black by default. updateTextPaint sets its size, typeface and letter spacing, but not its color, and PreparedLayoutTextView doesn't set one when it draws.

To check this on 0.89.0-rc.3, I set each prepared layout's layout.paint.color to baseTextAttributes.color from the app, by reflection, and redrew. The ellipsis then had the text's color. I haven't built React Native with a fix. Setting the paint's color in updateTextPaint when isColorSet is true should be enough, with resetTextPaint resetting it like the other attributes.

Steps to reproduce

  1. Run the reproducer below on Android: RNTester, Playground tab. Its component also runs as is in a new app. It uses the system font, and I ran it at a font scale of 1.0.
  2. Both lines are white and cut to one line, the second one at an inline view.
  3. The first line's ellipsis is white. The second line's is black, and should be white too.

React Native Version

0.89.0-rc.3

Affected Platforms

Runtime - Android

Output of npx @react-native-community/cli info

System:
  OS: Linux
Binaries:
  Node:
    version: 24.20.0
  npm:
    version: 11.19.0
Languages:
  Java:
    version: 21.0.12.1
npmPackages:
  "@react-native-community/cli":
    installed: 21.0.0-alpha.1
    wanted: 21.0.0-alpha.1
  react:
    installed: 19.3.0
    wanted: 19.3.0
  react-native:
    installed: 0.89.0-rc.3
    wanted: 0.89.0-rc.3
Android:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

No crash, and nothing in the logs.

MANDATORY Reproducer

#60390

Screenshots and Videos

Android 16 emulator, release builds, dark mode, font scale 1.0:

Two lines of white text on 0.88.1, 0.89.0-rc.3, main, and 0.89.0-rc.3 with the paint's color set. The second line's ellipsis is grey, black, black and white.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions