mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix RCTBaseTextInputView for iOS 17
Summary: The change in D47554161 is breaking builds for iOS 17 as the `addEntriesFromDictionary` method returns void and the code tries to assign the returned value to another dictionary. ## Changelog: [iOS][Fixed] - Use `addEntriesFromDictionary` properly in RCTBaseTextInputView. Reviewed By: sammy-SC Differential Revision: D47696854 fbshipit-source-id: 49e01fdc63b3f0478762994d5cafdceb16830c74
This commit is contained in:
committed by
Facebook GitHub Bot
parent
fc8ad8c659
commit
e6dd22c628
@@ -235,7 +235,8 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
|
||||
static NSDictionary<NSString *, NSString *> *contentTypeMap;
|
||||
|
||||
dispatch_once(&onceToken, ^{
|
||||
NSDictionary<NSString *, NSString *> *mutableContentTypeMap = @{
|
||||
NSMutableDictionary<NSString *, NSString *> *mutableContentTypeMap = [NSMutableDictionary new];
|
||||
[mutableContentTypeMap addEntriesFromDictionary:@{
|
||||
@"none" : @"",
|
||||
@"URL" : UITextContentTypeURL,
|
||||
@"addressCity" : UITextContentTypeAddressCity,
|
||||
@@ -264,11 +265,11 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
|
||||
@"password" : UITextContentTypePassword,
|
||||
@"newPassword" : UITextContentTypeNewPassword,
|
||||
@"oneTimeCode" : UITextContentTypeOneTimeCode,
|
||||
};
|
||||
}];
|
||||
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 170000 /* __IPHONE_17_0 */
|
||||
if (@available(iOS 17.0, *)) {
|
||||
mutableContentTypeMap = [[mutableContentTypeMap mutableCopy] addEntriesFromDictionary:@{
|
||||
[mutableContentTypeMap addEntriesFromDictionary:@{
|
||||
@"creditCardExpiration" : UITextContentTypeCreditCardExpiration,
|
||||
@"creditCardExpirationMonth" : UITextContentTypeCreditCardExpirationMonth,
|
||||
@"creditCardExpirationYear" : UITextContentTypeCreditCardExpirationYear,
|
||||
|
||||
+4
-3
@@ -181,7 +181,8 @@ UITextContentType RCTUITextContentTypeFromString(std::string const &contentType)
|
||||
static NSDictionary<NSString *, NSString *> *contentTypeMap;
|
||||
|
||||
dispatch_once(&onceToken, ^{
|
||||
NSDictionary<NSString *, NSString *> *mutableContentTypeMap = @{
|
||||
NSMutableDictionary<NSString *, NSString *> *mutableContentTypeMap = [NSMutableDictionary new];
|
||||
[mutableContentTypeMap addEntriesFromDictionary:@{
|
||||
@"" : @"",
|
||||
@"none" : @"",
|
||||
@"URL" : UITextContentTypeURL,
|
||||
@@ -211,11 +212,11 @@ UITextContentType RCTUITextContentTypeFromString(std::string const &contentType)
|
||||
@"password" : UITextContentTypePassword,
|
||||
@"newPassword" : UITextContentTypeNewPassword,
|
||||
@"oneTimeCode" : UITextContentTypeOneTimeCode,
|
||||
};
|
||||
}];
|
||||
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 170000 /* __IPHONE_17_0 */
|
||||
if (@available(iOS 17.0, *)) {
|
||||
mutableContentTypeMap = [[mutableContentTypeMap mutableCopy] addEntriesFromDictionary:@{
|
||||
[mutableContentTypeMap addEntriesFromDictionary:@{
|
||||
@"creditCardExpiration" : UITextContentTypeCreditCardExpiration,
|
||||
@"creditCardExpirationMonth" : UITextContentTypeCreditCardExpirationMonth,
|
||||
@"creditCardExpirationYear" : UITextContentTypeCreditCardExpirationYear,
|
||||
|
||||
Reference in New Issue
Block a user