Skip to content

Commit

Permalink
Improve auto-correct disabling on Android when obscureText is true (f…
Browse files Browse the repository at this point in the history
…lutter#3731)

Some keyboards (e.g., on some Samsung devices, SwiftKey) ignore
InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS and require
InputType.TYPE_TEXT_VARIATION_PASSWORD.
  • Loading branch information
cbracken authored Jun 2, 2017
1 parent 28e50a6 commit bd09286
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@ private static int inputTypeFromTextInputType(String inputType, boolean obscureT
textType |= InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS;
else if (inputType.equals("TextInputType.url"))
textType |= InputType.TYPE_TEXT_VARIATION_URI;
if (obscureText)
if (obscureText) {
// Note: both required. Some devices ignore TYPE_TEXT_FLAG_NO_SUGGESTIONS.
textType |= InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
textType |= InputType.TYPE_TEXT_VARIATION_PASSWORD;
}
return textType;
}

Expand Down

0 comments on commit bd09286

Please sign in to comment.