Skip to content

Commit 76604e7

Browse files
safaiyehalloy
authored andcommittedFeb 25, 2020
Resolve React-RCTText Xcode warning (#28054)
Summary: Resolve React-RCTText warning: `'UIKeyboardTypeASCIICapableNumberPad' is only available on iOS 10.0 or newer` ## Changelog [iOS] [Fixed] - Resolve React-RCTText Xcode warning Pull Request resolved: #28054 Test Plan: Build template, React-RCTText should no longer throw a warning. Differential Revision: D19887063 Pulled By: hramos fbshipit-source-id: 3437ee993babd7cdaec259af24526e197acb64bb
1 parent 8aeb5dc commit 76604e7

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed
 

‎Libraries/Text/TextInput/RCTBaseTextInputView.m

+19-8
Original file line numberDiff line numberDiff line change
@@ -569,14 +569,25 @@ - (void)setDefaultInputAccessoryView
569569

570570
// These keyboard types (all are number pads) don't have a "Done" button by default,
571571
// so we create an `inputAccessoryView` with this button for them.
572-
BOOL shouldHaveInputAccesoryView =
573-
(
574-
keyboardType == UIKeyboardTypeNumberPad ||
575-
keyboardType == UIKeyboardTypePhonePad ||
576-
keyboardType == UIKeyboardTypeDecimalPad ||
577-
keyboardType == UIKeyboardTypeASCIICapableNumberPad
578-
) &&
579-
textInputView.returnKeyType == UIReturnKeyDone;
572+
BOOL shouldHaveInputAccesoryView;
573+
if (@available(iOS 10.0, *)) {
574+
shouldHaveInputAccesoryView =
575+
(
576+
keyboardType == UIKeyboardTypeNumberPad ||
577+
keyboardType == UIKeyboardTypePhonePad ||
578+
keyboardType == UIKeyboardTypeDecimalPad ||
579+
keyboardType == UIKeyboardTypeASCIICapableNumberPad
580+
) &&
581+
textInputView.returnKeyType == UIReturnKeyDone;
582+
} else {
583+
shouldHaveInputAccesoryView =
584+
(
585+
keyboardType == UIKeyboardTypeNumberPad ||
586+
keyboardType == UIKeyboardTypePhonePad ||
587+
keyboardType == UIKeyboardTypeDecimalPad
588+
) &&
589+
textInputView.returnKeyType == UIReturnKeyDone;
590+
}
580591

581592
if (_hasInputAccesoryView == shouldHaveInputAccesoryView) {
582593
return;

0 commit comments

Comments
 (0)
Please sign in to comment.