mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
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:
1 parent
0527aea3d9
commit
216865cdb7
8 files changed
+176
-34
No files matched your search
@@ -200,6 +200,15 @@ export type TextContentType =
|
||||
| 'addressState'
|
||||
| 'countryName'
|
||||
| 'creditCardNumber'
|
||||
| 'creditCardExpiration'
|
||||
| 'creditCardExpirationMonth'
|
||||
| 'creditCardExpirationYear'
|
||||
| 'creditCardSecurityCode'
|
||||
| 'creditCardType'
|
||||
| 'creditCardName'
|
||||
| 'creditCardGivenName'
|
||||
| 'creditCardMiddleName'
|
||||
| 'creditCardFamilyName'
|
||||
| 'emailAddress'
|
||||
| 'familyName'
|
||||
| 'fullStreetAddress'
|
||||
@@ -220,7 +229,11 @@ export type TextContentType =
|
||||
| 'username'
|
||||
| 'password'
|
||||
| 'newPassword'
|
||||
| 'oneTimeCode';
|
||||
| 'oneTimeCode'
|
||||
| 'birthdate'
|
||||
| 'birthdateDay'
|
||||
| 'birthdateMonth'
|
||||
| 'birthdateYear';
|
||||
|
||||
export type enterKeyHintType =
|
||||
// Cross Platform
|
||||
@@ -462,7 +475,16 @@ export type Props = $ReadOnly<{|
|
||||
* - `additional-name`
|
||||
* - `address-line1`
|
||||
* - `address-line2`
|
||||
* - `birthdate-day` (iOS 17+)
|
||||
* - `birthdate-full` (iOS 17+)
|
||||
* - `birthdate-month` (iOS 17+)
|
||||
* - `birthdate-year` (iOS 17+)
|
||||
* - `cc-number`
|
||||
* - `cc-csc` (iOS 17+)
|
||||
* - `cc-exp` (iOS 17+)
|
||||
* - `cc-exp-day` (iOS 17+)
|
||||
* - `cc-exp-month` (iOS 17+)
|
||||
* - `cc-exp-year` (iOS 17+)
|
||||
* - `country`
|
||||
* - `current-password`
|
||||
* - `email`
|
||||
@@ -481,6 +503,11 @@ export type Props = $ReadOnly<{|
|
||||
*
|
||||
* The following values work on iOS only:
|
||||
*
|
||||
* - `cc-name` (iOS 17+)
|
||||
* - `cc-given-name` (iOS 17+)
|
||||
* - `cc-middle-name` (iOS 17+)
|
||||
* - `cc-family-name` (iOS 17+)
|
||||
* - `cc-type` (iOS 17+)
|
||||
* - `nickname`
|
||||
* - `organization`
|
||||
* - `organization-title`
|
||||
@@ -488,15 +515,6 @@ export type Props = $ReadOnly<{|
|
||||
*
|
||||
* The following values work on Android only:
|
||||
*
|
||||
* - `birthdate-day`
|
||||
* - `birthdate-full`
|
||||
* - `birthdate-month`
|
||||
* - `birthdate-year`
|
||||
* - `cc-csc`
|
||||
* - `cc-exp`
|
||||
* - `cc-exp-day`
|
||||
* - `cc-exp-month`
|
||||
* - `cc-exp-year`
|
||||
* - `gender`
|
||||
* - `name-family`
|
||||
* - `name-given`
|
||||
@@ -532,6 +550,11 @@ export type Props = $ReadOnly<{|
|
||||
| 'cc-exp-month'
|
||||
| 'cc-exp-year'
|
||||
| 'cc-number'
|
||||
| 'cc-name'
|
||||
| 'cc-given-name'
|
||||
| 'cc-middle-name'
|
||||
| 'cc-family-name'
|
||||
| 'cc-type'
|
||||
| 'country'
|
||||
| 'current-password'
|
||||
| 'email'
|
||||
@@ -1572,7 +1595,20 @@ const autoCompleteWebToAutoCompleteAndroidMap = {
|
||||
const autoCompleteWebToTextContentTypeMap = {
|
||||
'address-line1': 'streetAddressLine1',
|
||||
'address-line2': 'streetAddressLine2',
|
||||
bday: 'birthdate',
|
||||
'bday-day': 'birthdateDay',
|
||||
'bday-month': 'birthdateMonth',
|
||||
'bday-year': 'birthdateYear',
|
||||
'cc-csc': 'creditCardSecurityCode',
|
||||
'cc-exp-month': 'creditCardExpirationMonth',
|
||||
'cc-exp-year': 'creditCardExpirationYear',
|
||||
'cc-exp': 'creditCardExpiration',
|
||||
'cc-given-name': 'creditCardGivenName',
|
||||
'cc-additional-name': 'creditCardMiddleName',
|
||||
'cc-family-name': 'creditCardFamilyName',
|
||||
'cc-name': 'creditCardName',
|
||||
'cc-number': 'creditCardNumber',
|
||||
'cc-type': 'creditCardType',
|
||||
'current-password': 'password',
|
||||
country: 'countryName',
|
||||
email: 'emailAddress',
|
||||
|
||||
Reference in new issue
Block a user