Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix selectionColor doesn't style Android TextInput selection handles #31007

Closed

Conversation

fabOnReact
Copy link
Contributor

@fabOnReact fabOnReact commented Feb 17, 2021

Summary

This issue fixes #30283 selectionColor does not change the handles color.

The method setCursorColor changes the cursor color of field mCursorDrawable using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes).

Changelog

[Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles

Test Plan

This changes fix the Java API for which I can not write Java tests as explained in commit 709a441
The java TextInputTest was excluded from the test suite in commit 709a441 as they need the Yoga libraries to run

CLICK TO OPEN TESTS RESULTS - API 22

left/right handles do not change color with the cursor

BEFORE

center Handle color does not change color

BEFORE

The left and right handle change color with the cursor color

AFTER

The center handle color is correctly updated

AFTER

setCursorColor changes correctly the cursor color

AFTER

Default Colors do not have issues

AFTER
AFTER

@facebook-github-bot facebook-github-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 Feb 17, 2021
@fabOnReact fabOnReact changed the title setCursorColor update Handles color Fix selectionColor doesn't style Android TextInput selection handles Feb 17, 2021
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: c498c05

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,890,465 +207
android hermes armeabi-v7a 8,394,194 +206
android hermes x86 9,379,732 +213
android hermes x86_64 9,322,450 +218
android jsc arm64-v8a 10,341,308 +212
android jsc armeabi-v7a 9,828,121 +206
android jsc x86 10,392,072 +224
android jsc x86_64 10,975,040 +217

Base commit: c498c05

@fabOnReact fabOnReact marked this pull request as ready for review February 23, 2021 14:04
@facebook-github-bot
Copy link
Contributor

@mdvacca has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@f4z3k4s
Copy link

f4z3k4s commented Jun 21, 2021

Looking forward to this getting merged.

@facebook-github-bot
Copy link
Contributor

@sota000 merged this pull request in 5819538.

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. Merged This PR has been merged. Needs: React Native Team Attention
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TextInput's selectionColor doesn't style Android's selection handles
5 participants