Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
Saadnajmi merged 3 commits intomicrosoft:mainfromdlitsman:cursor-color
Apr 13, 2023

Conversation

@dlitsman
Copy link

@dlitsmandlitsman commentedApr 12, 2023
edited
Loading

Please select one of the following

  • I am removing an existing difference between facebook/react-native and microsoft/react-native-macos 👍
  • I am cherry-picking a change from Facebook's react-native into microsoft/react-native-macos 👍
  • I am making a fix / change for the macOS implementation of react-native
  • I am making a change required for Microsoft usage of react-native

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

@dlitsmandlitsman requested a review froma team as acode ownerApril 12, 2023 11:26
@dlitsman
Copy link
Author

@microsoft-github-policy-service agree company="Meta"

Saadnajmi reacted with thumbs up emoji

@dlitsman
Copy link
Author

Thanks for the review! 👍 Addressed comments

@SaadnajmiSaadnajmienabled auto-merge (squash)April 13, 2023 20:44
@SaadnajmiSaadnajmi merged commit3e66909 intomicrosoft:mainApr 13, 2023
jonthysell pushed a commit to microsoft/react-native-windows that referenced this pull requestApr 21, 2023
## 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
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@SaadnajmiSaadnajmiSaadnajmi approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@dlitsman@Saadnajmi

[8]ページ先頭

©2009-2025 Movatter.jp