[react-native] Added autoCompleteType to TextInputAndroidProps (#34824)

See https://github.com/facebook/react-native/pull/21575
This commit is contained in:
Danilo Bürger
2019-04-18 21:41:39 +02:00
committed by Eloy Durán
parent 10aca63078
commit 4d231b322c
2 changed files with 38 additions and 0 deletions

View File

@@ -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.

View File

@@ -641,6 +641,7 @@ class TextInputTest extends React.Component<{}, { username: string }> {
<TextInput
ref={input => (this.username = input)}
textContentType="username"
autoCompleteType="username"
value={this.state.username}
onChangeText={this.handleUsernameChange}
/>