feat: Support iOS 17 text content types (#38354)

Summary:
While setting up a credit card form in RN, I discovered that iOS 17 supports a number of new content types ([`UITextContentType` docs](https://developer.apple.com/documentation/uikit/uitextcontenttype?language=objc)). In the docs these are marked with the `Beta` flag.

Setting up the new content types is relatively straightforward, but a change is required in https://github.com/facebook/react-native-deprecated-modules to update the `TextInput` prop types. ~~I will open a PR in that repo shortly.~~ I have [opened a PR](https://github.com/facebook/react-native-deprecated-modules/pull/23) to update the prop types. ~~Once that PR is merged, a version bump for that dependency will need to be added to this PR.~~ The PR is merged and the dependency in this PR has been updated.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[IOS] [ADDED] - Added support for iOS 17+ text content types

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/38354

Test Plan: The `rn-tester` app builds and runs successfully. I have added a few new examples of inputs using the new text content types.

Reviewed By: javache

Differential Revision: D47554161

Pulled By: philIip

fbshipit-source-id: 8d4414dc6229063f81164f2d8727921c8294c92e
This commit is contained in:
Rob Walker
2023-07-20 20:31:04 -07:00
committed by Facebook GitHub Bot
parent 0527aea3d9
commit 216865cdb7
8 changed files with 176 additions and 34 deletions
@@ -807,6 +807,12 @@ exports.examples = ([
<WithLabel label="one-time-code">
<TextInput autoComplete="one-time-code" style={styles.default} />
</WithLabel>
<WithLabel label="birthdate-full">
<TextInput autoComplete="birthdate-full" style={styles.default} />
</WithLabel>
<WithLabel label="cc-name">
<TextInput autoComplete="cc-name" style={styles.default} />
</WithLabel>
</View>
);
},
@@ -829,6 +835,15 @@ exports.examples = ([
style={styles.default}
/>
</WithLabel>
<WithLabel label="creditCardExpiration">
<TextInput
textContentType="creditCardExpiration"
style={styles.default}
/>
</WithLabel>
<WithLabel label="birthdate">
<TextInput textContentType="birthdate" style={styles.default} />
</WithLabel>
</View>
);
},