react-native/Libraries/Text
Christian Brevik d4fb87b0b8 Add iOS 10 textContentType for TextInput
Summary:
Setting `textContentType` will provide the keyboard and system with semantic meaning for inputs. Should enable password/username autofill in apps running on iOS 11+ as demonstrated here: https://developer.apple.com/videos/play/wwdc2017/206/

Also gives you the ability to disable autofill by setting `textContentType="none"`: https://stackoverflow.com/questions/48489479/react-native-disable-password-autofill-option-on-ios-keyboard

Adding `textContentType` equal to `username` or `password`  should give you an autofill-bar over the keyboard which will let you fill in values from the device Keychain:

![image](https://user-images.githubusercontent.com/4932625/37848513-b2170490-2ed4-11e8-85bf-895823d4f98a.png)

Setting the appropriate `textContentType` will fill in the correct value in the `TextInput`.
I have only been able to get this to work on device, and not simulator.

Usage:
```jsx
<TextInput
    value={this.state.username}
    onChangeText={this.setUserName}
    textContentType="username"
/>
```

```jsx
<TextInput
    value={this.state.password}
    onChangeText={this.setPassword}
    secureTextEntry={true}
    textContentType="password"
/>
```

To disable:
```jsx
<TextInput
    value={this.state.password}
    onChangeText={this.setPassword}
    secureTextEntry={true}
    textContentType="none"
/>
```

This will set `textContentType` to an empty string: https://stackoverflow.com/a/46474180/5703116

<!--
  Does this PR require a documentation change?
  Create a PR at https://github.com/facebook/react-native-website and add a link to it here.
-->

Docs PR coming up.

[IOS] [MINOR] [TextInput] - Added `textContentType` prop for iOS 10+. Will enable password autofill for iOS 11+.
Closes https://github.com/facebook/react-native/pull/18526

Differential Revision: D7469630

Pulled By: hramos

fbshipit-source-id: 852a9749be98d477ecd82154c0a65a7c084521c1
2018-04-02 02:46:43 -07:00
..
BaseText Update license headers for MIT license 2018-02-16 18:31:53 -08:00
RCTText.xcodeproj iOS OSS: fixed RNTester - missing RCTInputAccessoryShadowView.* in .xcodeproj 2018-03-17 22:01:15 -07:00
RawText Update license headers for MIT license 2018-02-16 18:31:53 -08:00
Text Fixed problem in Text measurent on iOS 2018-02-25 09:37:38 -08:00
TextInput Add iOS 10 textContentType for TextInput 2018-04-02 02:46:43 -07:00
VirtualText Update license headers for MIT license 2018-02-16 18:31:53 -08:00
FabricText.js Add test for FabricText 2018-03-20 01:01:53 -07:00
RCTConvert+Text.h Update license headers for MIT license 2018-02-16 18:31:53 -08:00
RCTConvert+Text.m Update license headers for MIT license 2018-02-16 18:31:53 -08:00
RCTTextAttributes.h Update license headers for MIT license 2018-02-16 18:31:53 -08:00
RCTTextAttributes.m Adds _lineHeight = NAN; to RCTTextAttributes 2018-03-14 13:41:37 -07:00
Text.js Convert Text to ES6 Class 2018-03-12 18:06:28 -07:00
TextPropTypes.js Move Text PropTypes to it's own file 2018-03-10 18:39:47 -08:00
TextProps.js Fixing misuses of the Text type 2018-03-10 18:39:47 -08:00
TextStylePropTypes.js Update license headers for MIT license 2018-02-16 18:31:53 -08:00
TextUpdateTest.js Update license headers for MIT license 2018-02-16 18:31:53 -08:00