Fix text shadow on TextInput on Android when backgroundColor is set#45343
Closed
j-piasecki wants to merge 1 commit into
Closed
Fix text shadow on TextInput on Android when backgroundColor is set#45343j-piasecki wants to merge 1 commit into
backgroundColor is set#45343j-piasecki wants to merge 1 commit into
Conversation
Contributor
|
/rebase |
66b469a to
b22bd53
Compare
Base commit: 12b64b7 |
Contributor
|
@cortinico has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Contributor
|
@cortinico merged this pull request in 8371629. |
|
This pull request was successfully merged by @j-piasecki in 8371629. When will my fix make it into a release? | How to file a pick request? |
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:
When setting a shadow on a
Textinside aTextInput, the shadow was rendered with artifacts whenbackgroundColorwas set on theTextInput.This is caused by how attributed strings are constructed on the new architecture - all text attributes from the text input (including background color) are propagated onto the string. Then, it's converted to a
Spannableon Android side, which includesReactBackgroundColorSpanbeing set on the entire text when it doesn't have a background color set explicitly. Then Android tries to render the shadow not only for the text but also for the background rect which results in the artifacts.This PR prevents background color from the
TextInputfrom being propagated onto the attributed string, so theReactBackgroundColorSpanis only applied when a text fragment has its background set explicitly.Changelog:
[ANDROID] [FIXED] - Fixed text shadow rendering with artifacts when
backgroundColorwas set on theTextInputTest Plan:
Checked relevant examples on RNTester