mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-09 22:43:10 +08:00
Add TextInput's prop caretHidden implementation for Android and add the prop to docs
Summary:
This PR will:
- add missing documentation for `caretHidden` prop to the docs
- add `caretHidden` prop implementation for Android
I noticed this by accident when looking at `RCTTextFieldManager.m` and there is `RCT_EXPORT_VIEW_PROPERTY(caretHidden, BOOL)` which hides caret on iOS. Then I realised that the docs were missing for this prop and implementation on Android side :)
Render `TextInput` with prop `caretHidden`. After this caret is not visible anymore.
`<TextInput style={styles.input} caretHidden />`
If you omit the prop then caret is visible again
`<TextInput style={styles.input} />`
Closes https://github.com/facebook/react-native/pull/11863
Differential Revision: D4448402
fbshipit-source-id: 456e1df3e2cbb8af32540d2c7a8f4e7da219f5c3
This commit is contained in:
committed by
Facebook Github Bot
parent
fab09922cd
commit
bb1f85183b
@@ -346,6 +346,11 @@ public class ReactTextInputManager extends BaseViewManager<ReactEditText, Layout
|
||||
} catch (IllegalAccessException ex) {}
|
||||
}
|
||||
|
||||
@ReactProp(name = "caretHidden", defaultBoolean = false)
|
||||
public void setCaretHidden(ReactEditText view, boolean caretHidden) {
|
||||
view.setCursorVisible(!caretHidden);
|
||||
}
|
||||
|
||||
@ReactProp(name = "selectTextOnFocus", defaultBoolean = false)
|
||||
public void setSelectTextOnFocus(ReactEditText view, boolean selectTextOnFocus) {
|
||||
view.setSelectAllOnFocus(selectTextOnFocus);
|
||||
|
||||
Reference in New Issue
Block a user