From 4d231b322ce8e95a2f5be775cc922e99b52053ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danilo=20B=C3=BCrger?= Date: Thu, 18 Apr 2019 21:41:39 +0200 Subject: [PATCH] [react-native] Added autoCompleteType to TextInputAndroidProps (#34824) See https://github.com/facebook/react-native/pull/21575 --- types/react-native/index.d.ts | 37 +++++++++++++++++++++++++++++++ types/react-native/test/index.tsx | 1 + 2 files changed, 38 insertions(+) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 78cf6698b7..9e8e378cf3 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -1107,6 +1107,43 @@ export interface TextInputIOSProps { * @see https://facebook.github.io/react-native/docs/textinput.html#props */ export interface TextInputAndroidProps { + /** + * 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` + */ + autoCompleteType?: + | "cc-csc" + | "cc-exp" + | "cc-exp-month" + | "cc-exp-year" + | "cc-number" + | "email" + | "name" + | "password" + | "postal-code" + | "street-address" + | "tel" + | "username" + | "off"; + /** * When false, if there is a small amount of space available around a text input (e.g. landscape orientation on a phone), * the OS may choose to have the user edit the text inside of a full screen text input mode. diff --git a/types/react-native/test/index.tsx b/types/react-native/test/index.tsx index d6f55c3f4d..8a844e01d8 100644 --- a/types/react-native/test/index.tsx +++ b/types/react-native/test/index.tsx @@ -641,6 +641,7 @@ class TextInputTest extends React.Component<{}, { username: string }> { (this.username = input)} textContentType="username" + autoCompleteType="username" value={this.state.username} onChangeText={this.handleUsernameChange} />