-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Error while updating property 'selectionColor' on 0.43.3 in Android #13465
Comments
Summary: **Motivation** Customizing the selection color allows to use brand colors in the app. The PR implements a `selectionColor` prop for `Text` component similar to `TextInput`. **Test plan (required)** Run UIExplorer example with the changes and verify everything works fine. ![image](https://cloud.githubusercontent.com/assets/1174278/22023258/70197d84-dceb-11e6-8662-2879d78d14d4.png) cc brentvatne Closes #11947 Differential Revision: D4430265 fbshipit-source-id: 462f16548d93ab03aadb27d6f12acf90842627ab
Summary: This matches the behavior on iOS, there was no way before to change the cursor color per input, it was only possible to change it globally via the theme. Ideally cursor color and selection color would be 2 different props but I think this is better than what we have (and matches iOS). Sadly there is no api to change it pragmatically (only possible via xml) so this uses reflection and can easily break so it is wrapped in a try catch to avoid crashes. I think it is better to just silently fail in this case. Definetly not super happy about the solution but I think it's worth adding since it is possible to do it natively using xml so it would suck not to be able to do it in RN. **Test plan** Tested that the cursor has the same color as before the change when not setting the prop and that it gets the selectionColor color when set. Closes #12280 Differential Revision: D4571858 Pulled By: astreet fbshipit-source-id: 7dca2db33a0a4eecb6115b45155549b1265ffbed
Are you able to show more logs of the error? Maybe with adb logcat. Also what version of android and device are you using? |
Thx @janicduplessis for your answer.. Device: Genymotion - Google Nexus 5X (7.0.0 API 24)
|
I'm trying to debug the error.. It's on this line when it stops working. I do not know very well how it works ... I leave a catch of the debugger in case someone can help ... |
I FOUND BUG!!!! |
Nice! Thanks for figuring this out :) |
Related issue: facebook/react-native#13465 fbshipit-source-id: 06176b7
@krailler @janicduplessis Thanks for yours!
|
@krailler @janicduplessis |
Description
When updating to React 0.43.3, when I use the selectionColor property in TextInput on Android, it gives me the following error message. Did something change? In the documentation is still as before.
This has something to do? ae57b25
Reproduction Steps and Sample Code
<TextInput selectionColor="red" />
Additional Information
The text was updated successfully, but these errors were encountered: