Skip to content

Commit

Permalink
Adding missing prop for RN Android TextInput behavior
Browse files Browse the repository at this point in the history
Summary:
An issue that popped up working on:
D36140890
There is already behavior implemented to set the TextInput caret/cursor color independently from the selection box color in Android.
However this handy prop, was not documented or added as one of the available props for the TextInput component.

Associated behavior can be found here:
https://www.internalfb.com/code/fbsource/[f116d651b2e8]/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java?lines=512

## **Changelog**
[Android] - Add android-only prop documentation at the TextInput js level.

Reviewed By: genkikondo

Differential Revision: D36208656

fbshipit-source-id: a54a2646351d897e0d598d5e1979f2a0c443e9d6
  • Loading branch information
Christian Ruink authored and facebook-github-bot committed May 10, 2022
1 parent 6915fce commit f2e2321
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Libraries/Components/TextInput/TextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,14 @@ type AndroidProps = $ReadOnly<{|
| 'off'
),

/**
* When provided it will set the color of the cursor (or "caret") in the component.
* Unlike the behavior of `selectionColor` the cursor color will be set independently
* from the color of the text selection box.
* @platform android
*/
cursorColor?: ?ColorValue,

/**
* When `false`, if there is a small amount of space available around a text input
* (e.g. landscape orientation on a phone), the OS may choose to have the user edit
Expand Down

0 comments on commit f2e2321

Please sign in to comment.