- Notifications
You must be signed in to change notification settings - Fork151
Add cursorColor support to TextInput#1787
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
dlitsman commentedApr 12, 2023
@microsoft-github-policy-service agree company="Meta" |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
dlitsman commentedApr 12, 2023
Thanks for the review! 👍 Addressed comments |
Uh oh!
There was an error while loading.Please reload this page.
## DescriptionI've added the support for the `cursorColor` property to the macOS repo already. This PR will help to keep parity between platformsmicrosoft/react-native-macos#1787 ### Type of Change- New feature (non-breaking change which adds functionality)### WhyFor our needs, we need to have more control over cursor/caret color. The `cusrorColor` property is already available on macOS aftermicrosoft/react-native-macos#1787 and documented in the docshttps://reactnative.dev/docs/textinput#cursorcolor-android. However, there is currently no way to update the cursor/caret color on Windows.### What- I've extended `HideCaretIfNeeded` logic to support the custom color of a caret. This function is already, in a sense, changing the color of a caret; however, it always sets it to be transparent. Now, we allow custom colors as well- Updated demo textinput page to have test cases for it## Screenshotshttps://user-images.githubusercontent.com/963490/232445282-96c509e8-801d-4009-bbfd-c061340f53e8.mp4
Uh oh!
There was an error while loading.Please reload this page.
Please select one of the following
Summary
In the current implementation of TextInput, there is no reliable way to specify cursorColor (caret color).
This prop is already supported in Android and documented in the main dochttps://reactnative.dev/docs/textinput#cursorcolor-android This pull request adds support to macOS as well.
To demonstrate, here cursor is actually rendered, but you cannot see it as it is black on black.
Screen.Recording.2023-04-12.at.12.01.33.mov
TextInput implementation seems to be different between MacOS and iOS, so creating a pull request here.
Changelog
[MACOS] [ADDED] - Added support for cursorColor prop in TextInput
Test Plan
Run RNTester-macOS as explained in the guidehttps://github.com/microsoft/react-native-macos/tree/main/packages/rn-tester#running-on-ios
Screen.Recording.2023-04-12.at.12.08.20.mov