diff --git a/Libraries/Components/TextInput/TextInput.js b/Libraries/Components/TextInput/TextInput.js index 296b6ec72dc..e9aa082f9cd 100644 --- a/Libraries/Components/TextInput/TextInput.js +++ b/Libraries/Components/TextInput/TextInput.js @@ -223,6 +223,21 @@ type IOSProps = $ReadOnly<{| |}>; type AndroidProps = $ReadOnly<{| + autoCompleteType?: ?( + | 'cc-csc' + | 'cc-exp' + | 'cc-exp-month' + | 'cc-exp-year' + | 'cc-number' + | 'email' + | 'name' + | 'password' + | 'postal-code' + | 'street-address' + | 'tel' + | 'username' + | 'off' + ), returnKeyLabel?: ?string, numberOfLines?: ?number, disableFullscreenUI?: ?boolean, @@ -413,6 +428,45 @@ const TextInput = createReactClass({ 'words', 'characters', ]), + /** + * Determines which content to suggest on auto complete, e.g.`username`. + * To disable auto complete, use `off`. + * + * *Android Only* + * + * The following values work on Android only: + * + * - `username` + * - `password` + * - `email` + * - `name` + * - `tel` + * - `street-address` + * - `postal-code` + * - `cc-number` + * - `cc-csc` + * - `cc-exp` + * - `cc-exp-month` + * - `cc-exp-year` + * - `off` + * + * @platform android + */ + autoCompleteType: PropTypes.oneOf([ + 'cc-csc', + 'cc-exp', + 'cc-exp-month', + 'cc-exp-year', + 'cc-number', + 'email', + 'name', + 'password', + 'postal-code', + 'street-address', + 'tel', + 'username', + 'off', + ]), /** * If `false`, disables auto-correct. The default value is `true`. */ 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 3ad69adba04..74ac875be6b 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 @@ -529,6 +529,41 @@ public class ReactTextInputManager extends BaseViewManager