Fix transparent color on Text on android#55380
Open
intergalacticspacehighway wants to merge 2 commits intofacebook:mainfrom
Open
Fix transparent color on Text on android#55380intergalacticspacehighway wants to merge 2 commits intofacebook:mainfrom
transparent color on Text on android#55380intergalacticspacehighway wants to merge 2 commits intofacebook:mainfrom
Conversation
| @@ -179,7 +179,7 @@ TextAttributes TextAttributes::defaultTextAttributes() { | |||
| auto defaultAttrs = TextAttributes{}; | |||
| // Non-obvious (can be different among platforms) default text attributes. | |||
| defaultAttrs.foregroundColor = blackColor(); | |||
| defaultAttrs.backgroundColor = clearColor(); | |||
| defaultAttrs.backgroundColor = SharedColor{}; | |||
Contributor
Author
There was a problem hiding this comment.
This change was needed to fix fantom tests. Fantom tests run on platform/cxx platform where clearColor was treated as false (same as android). iOS was treating it as true. So this also change makes it consistent on all platforms.
af5d2be to
f8597f4
Compare
f8597f4 to
ab7f5e7
Compare
6 tasks
janicduplessis
added a commit
to tloncorp/tlon-apps
that referenced
this pull request
Apr 23, 2026
The OTP input overlays a hidden TextInput on top of the visual digit cells. RN 0.81 (Expo SDK 54) regressed handling of `color: 'transparent'` on Android, causing the underlying glyphs to paint on top of the cell overlay and appear as duplicated/ghosted digits. Using `#ffffff00` instead of the `'transparent'` keyword avoids the regression until the upstream fix ships. Refs: - facebook/react-native#53343 - facebook/react-native#55380
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Fixes - #53343. Passing
transparentinto text color renders black color text on android.This broke with a fix implemented here. The issue is that if user passes
transparenttext color from JS, it gets converted to0value on platform. Currently,0is treated as Undefined on android, which causes this check to fail becausebooloverride function returns false thinking the passed color isUndefined😅 . Default text attribute is black color so android keeps the black color instead of overriding it withtransparent.This PR fixes it by removing the concept of
Undefinedplatform color and introducing adefinedproperty toSharedColor. This will make it consistent on different platforms. If user doesSharedColor(), they'll get an undefined color (in bool checks) andSharedColor(red)would give a defined shared color.Changelog:
[ANDROID] [FIXED] - Transparent text color renders black text.
Test Plan:
ColorTest.cpp