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

TextInput cursor color #2757

Closed
davepaiva opened this issue Jun 2, 2021 · 6 comments
Closed

TextInput cursor color #2757

davepaiva opened this issue Jun 2, 2021 · 6 comments

Comments

@davepaiva
Copy link

davepaiva commented Jun 2, 2021

Is there any way we can change the cursor colour using any props from the TextInput component from this library?
I have seen posts where we can change the colour by specifying colours in android/app/src/main/res/values/styles.xml etc.
But this is not ideal for me as I require different colours in different places .
react-native version 0.61.5
react-native-paper version 4.9.1
react-native-vector-icons version 8.1.0
Thanks.

@github-actions
Copy link

github-actions bot commented Jun 2, 2021

Couldn't find version numbers for the following packages in the issue:

  • react-native
  • react-native-paper
  • react-native-vector-icons

Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.

@github-actions
Copy link

github-actions bot commented Jun 2, 2021

Hey! Thanks for opening the issue. The issue doesn't seem to contain a link to a repro (a snack.expo.io link or link to a GitHub repo under your username).

Can you provide a minimal repro which demonstrates the issue? A repro will help us debug the issue faster. Please try to keep the repro as small as possible and make sure that we can run it without additional setup.

@lukewalczak
Copy link
Member

You can change the caret color along with selection color using prop selectionColor on mobile platform.

@ferrannp
Copy link
Collaborator

ferrannp commented Jun 4, 2021

@davepaiva this is a React Native bug. See facebook/react-native#30283. selectionColor will style the selection cursors but not the caret. To style the caret you can do it as you say with styles.xml. It looks to me that this PR facebook/react-native#31007 might solve the issue... You can try using patch-package.

@davepaiva
Copy link
Author

davepaiva commented Jun 5, 2021

@davepaiva this is a React Native bug. See facebook/react-native#30283. selectionColor will style the selection cursors but not the caret. To style the caret you can do it as you say with styles.xml. It looks to me that this PR facebook/react-native#31007 might solve the issue... You can try using patch-package.

You can change the caret color along with selection color using prop selectionColor on mobile platform.

Unfortunately, selectionColor just changes the bg colour of the selected text and not the cursor

@github-actions
Copy link

github-actions bot commented Aug 5, 2021

Hello 👋, this issue has been open for more than 2 months with no activity on it. If the issue is still present in the latest version, please leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution on workaround for the issue, please comment here for others to find. If this issue is critical for you, please consider sending a pull request to fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants