Skip to content

Commit

Permalink
feat: add iOS version checks to smartInsertDelete prop
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioh8010 committed Feb 9, 2023
1 parent 6fdaef2 commit bb900c5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,10 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &
}

if (newTextInputProps.traits.smartInsertDelete != oldTextInputProps.traits.smartInsertDelete) {
_backedTextInputView.smartInsertDeleteType =
RCTUITextSmartInsertDeleteTypeFromOptionalBool(newTextInputProps.traits.smartInsertDelete);
if (@available(iOS 11.0, *)) {
_backedTextInputView.smartInsertDeleteType =
RCTUITextSmartInsertDeleteTypeFromOptionalBool(newTextInputProps.traits.smartInsertDelete);
}
}

// Traits `blurOnSubmit`, `clearTextOnFocus`, and `selectTextOnFocus` were omitted intentially here
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ void RCTCopyBackedTextInput(
toTextInput.secureTextEntry = fromTextInput.secureTextEntry;
toTextInput.keyboardType = fromTextInput.keyboardType;
toTextInput.textContentType = fromTextInput.textContentType;
toTextInput.smartInsertDeleteType = fromTextInput.smartInsertDeleteType;

if (@available(iOS 11.0, *)) {
toTextInput.smartInsertDeleteType = fromTextInput.smartInsertDeleteType;
}

if (@available(iOS 12.0, *)) {
toTextInput.passwordRules = fromTextInput.passwordRules;
Expand Down

0 comments on commit bb900c5

Please sign in to comment.