Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Libraries/Components/TextInput/TextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ export type TextContentType =
| 'newPassword'
| 'oneTimeCode';

type PasswordRules = string;

type IOSProps = $ReadOnly<{|
spellCheck?: ?boolean,
keyboardAppearance?: ?('default' | 'light' | 'dark'),
Expand All @@ -220,6 +222,7 @@ type IOSProps = $ReadOnly<{|
| $ReadOnlyArray<DataDetectorTypesType>,
inputAccessoryViewID?: ?string,
textContentType?: ?TextContentType,
PasswordRules?: ?PasswordRules,
scrollEnabled?: ?boolean,
|}>;

Expand Down
10 changes: 10 additions & 0 deletions Libraries/Text/TextInput/RCTBaseTextInputView.m
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,16 @@ - (void)setTextContentType:(NSString *)type
#endif
}


- (void)setPasswordRules:(NSString *)descriptor
{
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_12_0
if (@available(iOS 12.0, *)) {
self.backedTextInputView.passwordRules = [UITextInputPasswordRules passwordRulesWithDescriptor:descriptor];
}
#endif
}

- (UIKeyboardType)keyboardType
{
return self.backedTextInputView.keyboardType;
Expand Down
1 change: 1 addition & 0 deletions Libraries/Text/TextInput/RCTBaseTextInputViewManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ @implementation RCTBaseTextInputViewManager
RCT_EXPORT_VIEW_PROPERTY(selection, RCTTextSelection)
RCT_EXPORT_VIEW_PROPERTY(inputAccessoryViewID, NSString)
RCT_EXPORT_VIEW_PROPERTY(textContentType, NSString)
RCT_EXPORT_VIEW_PROPERTY(passwordRules, NSString)

RCT_EXPORT_VIEW_PROPERTY(onChange, RCTBubblingEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onSelectionChange, RCTDirectEventBlock)
Expand Down