From f45023b1aa580ff77bc70e6845daf8a9eaa776ee Mon Sep 17 00:00:00 2001 From: Cherie Woo Date: Thu, 31 Aug 2017 22:24:40 -0700 Subject: [PATCH] Added in missing ReactProp The missing autoComplete is the reason why some Samsungs and HTC can't turn off autoSuggestion/autoCompletion successfully. https://stackoverflow.com/questions/37001070/how-to-avoid-the-suggestions-of-keyboard-for-android-in-react-native --- .../views/textinput/ReactTextInputManager.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java index f8d1862e0fa84e..1d38196db69e32 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java @@ -487,7 +487,18 @@ public void setAutoCorrect(ReactEditText view, @Nullable Boolean autoCorrect) { InputType.TYPE_TEXT_FLAG_AUTO_CORRECT : InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS) : 0); } - + + @ReactProp(name = "autoComplete") + public void setAutoComplete(ReactEditText view, @Nullable Boolean autoComplete) { + updateStagedInputTypeFlag( + view, + InputType.TYPE_TEXT_FLAG_AUTO_CORRECT | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS | TYPE_TEXT_VARIATION_VISIBLE_PASSWORD, + autoComplete != null ? + (autoComplete.booleanValue() ? + InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS : InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD) + : 0); + } + @ReactProp(name = "multiline", defaultBoolean = false) public void setMultiline(ReactEditText view, boolean multiline) { updateStagedInputTypeFlag(