Skip to content

Commit 09cfb30

Browse files
committed
feat: add iOS version checks to smartInsertDelete prop
1 parent 53b1261 commit 09cfb30

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,10 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &
182182
}
183183

184184
if (newTextInputProps.traits.smartInsertDelete != oldTextInputProps.traits.smartInsertDelete) {
185-
_backedTextInputView.smartInsertDeleteType =
186-
RCTUITextSmartInsertDeleteTypeFromOptionalBool(newTextInputProps.traits.smartInsertDelete);
185+
if (@available(iOS 11.0, *)) {
186+
_backedTextInputView.smartInsertDeleteType =
187+
RCTUITextSmartInsertDeleteTypeFromOptionalBool(newTextInputProps.traits.smartInsertDelete);
188+
}
187189
}
188190

189191
// Traits `blurOnSubmit`, `clearTextOnFocus`, and `selectTextOnFocus` were omitted intentionally here

packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ void RCTCopyBackedTextInput(
4343
toTextInput.secureTextEntry = fromTextInput.secureTextEntry;
4444
toTextInput.keyboardType = fromTextInput.keyboardType;
4545
toTextInput.textContentType = fromTextInput.textContentType;
46-
toTextInput.smartInsertDeleteType = fromTextInput.smartInsertDeleteType;
46+
47+
if (@available(iOS 11.0, *)) {
48+
toTextInput.smartInsertDeleteType = fromTextInput.smartInsertDeleteType;
49+
}
4750

4851
toTextInput.passwordRules = fromTextInput.passwordRules;
4952

0 commit comments

Comments
 (0)