diff --git a/Libraries/Text/TextInput/RCTBaseTextInputView.m b/Libraries/Text/TextInput/RCTBaseTextInputView.m index 6966dbd7f09..b9882d34efa 100644 --- a/Libraries/Text/TextInput/RCTBaseTextInputView.m +++ b/Libraries/Text/TextInput/RCTBaseTextInputView.m @@ -569,14 +569,25 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame) // These keyboard types (all are number pads) don't have a "Done" button by default, // so we create an `inputAccessoryView` with this button for them. - BOOL shouldHaveInputAccesoryView = - ( - keyboardType == UIKeyboardTypeNumberPad || - keyboardType == UIKeyboardTypePhonePad || - keyboardType == UIKeyboardTypeDecimalPad || - keyboardType == UIKeyboardTypeASCIICapableNumberPad - ) && - textInputView.returnKeyType == UIReturnKeyDone; + BOOL shouldHaveInputAccesoryView; + if (@available(iOS 10.0, *)) { + shouldHaveInputAccesoryView = + ( + keyboardType == UIKeyboardTypeNumberPad || + keyboardType == UIKeyboardTypePhonePad || + keyboardType == UIKeyboardTypeDecimalPad || + keyboardType == UIKeyboardTypeASCIICapableNumberPad + ) && + textInputView.returnKeyType == UIReturnKeyDone; + } else { + shouldHaveInputAccesoryView = + ( + keyboardType == UIKeyboardTypeNumberPad || + keyboardType == UIKeyboardTypePhonePad || + keyboardType == UIKeyboardTypeDecimalPad + ) && + textInputView.returnKeyType == UIReturnKeyDone; + } if (_hasInputAccesoryView == shouldHaveInputAccesoryView) { return;