Skip to content

Fix initial underlineColorAndroid application in Fabric - #58003

Open
97Fakhreddine wants to merge 1 commit into
react:mainfrom
97Fakhreddine:fix/android-text-input-underline-color
Open

Fix initial underlineColorAndroid application in Fabric#58003
97Fakhreddine wants to merge 1 commit into
react:mainfrom
97Fakhreddine:fix/android-text-input-underline-color

Conversation

@97Fakhreddine

@97Fakhreddine 97Fakhreddine commented Aug 18, 2026

Copy link
Copy Markdown

Summary:

Fixes #57921.

On Android Fabric, underlineColorAndroid can be applied before a TextInput has a background drawable. ReactTextInputManager.setUnderlineColor currently returns in that case, so the initial prop value is lost and is only applied after a later render.

This change moves underline color handling into ReactEditText, where the requested color is retained and reapplied when a background drawable becomes available. When React Native has wrapped the native background in a CompositeBackgroundDrawable, the color filter is applied to its original Android background instead of the wrapper.

A Robolectric regression test covers applying the prop while the background is null and then installing the background drawable.

Changelog:

[ANDROID] [FIXED] - Apply underlineColorAndroid on the initial Fabric render when the TextInput background becomes available later

Test Plan:

  • Added testUnderlineColorAppliedWhenBackgroundBecomesAvailable to ReactTextInputPropertyTest.
  • git diff --check passes.
  • CI: ./gradlew :packages:react-native:ReactAndroid:testDebugUnitTest --tests com.facebook.react.views.textinput.ReactTextInputPropertyTest.testUnderlineColorAppliedWhenBackgroundBecomesAvailable
  • Not run locally: the Gradle distribution download was unavailable in the execution environment.

@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 Aug 18, 2026
@97Fakhreddine 97Fakhreddine changed the title fix: 🐛 Fix initial underlineColorAndroid application in Fabric Fix initial underlineColorAndroid application in Fabric Aug 18, 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 Aug 18, 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.

underlineColorAndroid silently ignored on initial render with Fabric (New Architecture)

1 participant