Skip to content

Commit

Permalink
feat(iOS): add support for missing text content types (#42788)
Browse files Browse the repository at this point in the history
Summary:
This PR adds few missing text content types on iOS (available from iOS 15)

- dateTime
- flightNumber
- shipmentTrackingNumber

## Changelog:

[IOS] [ADDED] - Add support for missing text content types

Pull Request resolved: #42788

Test Plan: Make sure that `RNTester` builds and runs successfully

Reviewed By: robhogan

Differential Revision: D61656748

Pulled By: cipolleschi

fbshipit-source-id: e960eded5f049d3c4bf76a5a4e3159b240546288
  • Loading branch information
krozniata authored and facebook-github-bot committed Aug 23, 2024
1 parent 17613fc commit d7a3e48
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,14 @@ - (void)setTextContentType:(NSString *)type
@"oneTimeCode" : UITextContentTypeOneTimeCode,
}];

if (@available(iOS 15.0, *)) {
[mutableContentTypeMap addEntriesFromDictionary:@{
@"dateTime" : UITextContentTypeDateTime,
@"flightNumber" : UITextContentTypeFlightNumber,
@"shipmentTrackingNumber" : UITextContentTypeShipmentTrackingNumber,
}];
}

#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 170000 /* __IPHONE_17_0 */
if (@available(iOS 17.0, *)) {
[mutableContentTypeMap addEntriesFromDictionary:@{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,14 @@ UITextContentType RCTUITextContentTypeFromString(const std::string &contentType)
@"oneTimeCode" : UITextContentTypeOneTimeCode,
}];

if (@available(iOS 15.0, *)) {
[mutableContentTypeMap addEntriesFromDictionary:@{
@"dateTime" : UITextContentTypeDateTime,
@"flightNumber" : UITextContentTypeFlightNumber,
@"shipmentTrackingNumber" : UITextContentTypeShipmentTrackingNumber,
}];
}

#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 170000 /* __IPHONE_17_0 */
if (@available(iOS 17.0, *)) {
[mutableContentTypeMap addEntriesFromDictionary:@{
Expand Down

0 comments on commit d7a3e48

Please sign in to comment.