Skip to content

Commit

Permalink
Allow non-amtching textContentTypes to pass through
Browse files Browse the repository at this point in the history
  • Loading branch information
levibuzolic committed Dec 19, 2018
1 parent 669c1b6 commit 4118d50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Libraries/Text/TextInput/RCTBaseTextInputView.m
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ - (void)setTextContentType:(NSString *)type
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 120000 /* __IPHONE_12_0 */
if (@available(iOS 12.0, *)) {
NSDictionary<NSString *, NSString *> * iOS12extras = @{@"newPassword": UITextContentTypeNewPassword,
@"oneTimeCode": UITextContentTypeOneTimeCode};
@"oneTimeCode": UITextContentTypeOneTimeCode};

NSMutableDictionary<NSString *, NSString *> * iOS12baseMap = [contentTypeMap mutableCopy];
[iOS12baseMap addEntriesFromDictionary:iOS12extras];
Expand All @@ -251,7 +251,7 @@ - (void)setTextContentType:(NSString *)type

// Setting textContentType to an empty string will disable any
// default behaviour, like the autofill bar for password inputs
self.backedTextInputView.textContentType = type ? contentTypeMap[type] : type;
self.backedTextInputView.textContentType = contentTypeMap[type] ?: type;
}
#endif
}
Expand Down

0 comments on commit 4118d50

Please sign in to comment.