Fix initial underlineColorAndroid application in Fabric - #58003
Open
97Fakhreddine wants to merge 1 commit into
Open
Fix initial underlineColorAndroid application in Fabric#5800397Fakhreddine wants to merge 1 commit into
97Fakhreddine wants to merge 1 commit into
Conversation
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 #57921.
On Android Fabric,
underlineColorAndroidcan be applied before aTextInputhas a background drawable.ReactTextInputManager.setUnderlineColorcurrently 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 aCompositeBackgroundDrawable, 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
underlineColorAndroidon the initial Fabric render when the TextInput background becomes available laterTest Plan:
testUnderlineColorAppliedWhenBackgroundBecomesAvailabletoReactTextInputPropertyTest.git diff --checkpasses../gradlew :packages:react-native:ReactAndroid:testDebugUnitTest --tests com.facebook.react.views.textinput.ReactTextInputPropertyTest.testUnderlineColorAppliedWhenBackgroundBecomesAvailable