mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-07 09:27:29 +08:00
Implement TextInput.selectTextOnFocus for Android
Summary:Uses native Android `TextView.setSelectAllOnFocus` method. Triggers TextInput's `onSelectionChanged` event on focus as expected. Closes https://github.com/facebook/react-native/pull/6654 Differential Revision: D3126354 Pulled By: mkonicek fb-gh-sync-id: faa64314c0ddc87296277ccd707f18effef8f407 fbshipit-source-id: faa64314c0ddc87296277ccd707f18effef8f407
This commit is contained in:
committed by
Facebook Github Bot 2
parent
41b0160b60
commit
b5106a8fca
@@ -209,6 +209,11 @@ public class ReactTextInputManager extends BaseViewManager<ReactEditText, Layout
|
||||
}
|
||||
}
|
||||
|
||||
@ReactProp(name = "selectTextOnFocus", defaultBoolean = false)
|
||||
public void setSelectTextOnFocus(ReactEditText view, boolean selectTextOnFocus) {
|
||||
view.setSelectAllOnFocus(selectTextOnFocus);
|
||||
}
|
||||
|
||||
@ReactProp(name = ViewProps.COLOR, customType = "Color")
|
||||
public void setColor(ReactEditText view, @Nullable Integer color) {
|
||||
if (color == null) {
|
||||
|
||||
Reference in New Issue
Block a user