Skip to content

Commit 6d9fe45

Browse files
Peter Arganyfacebook-github-bot
Peter Argany
authored andcommitted
Fixed TVOS test failure caused by input accessory view change
Reviewed By: mmmulani Differential Revision: D7103353 fbshipit-source-id: 7a1575eff0296017521fc8ca6fe384301849a73e
1 parent 2dd2529 commit 6d9fe45

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Libraries/Text/TextInput/RCTBaseTextInputView.m

+4-2
Original file line numberDiff line numberDiff line change
@@ -402,17 +402,16 @@ - (void)didMoveToWindow
402402

403403
- (void)didSetProps:(NSArray<NSString *> *)changedProps
404404
{
405-
#if !TARGET_OS_TV
406405
if ([changedProps containsObject:@"inputAccessoryViewID"] && self.inputAccessoryViewID) {
407406
[self setCustomInputAccessoryViewWithNativeID:self.inputAccessoryViewID];
408407
} else if (!self.inputAccessoryViewID) {
409408
[self setDefaultInputAccessoryView];
410409
}
411-
#endif
412410
}
413411

414412
- (void)setCustomInputAccessoryViewWithNativeID:(NSString *)nativeID
415413
{
414+
#if !TARGET_OS_TV
416415
__weak RCTBaseTextInputView *weakSelf = self;
417416
[_bridge.uiManager rootViewForReactTag:self.reactTag withCompletion:^(UIView *rootView) {
418417
RCTBaseTextInputView *strongSelf = weakSelf;
@@ -425,10 +424,12 @@ - (void)setCustomInputAccessoryViewWithNativeID:(NSString *)nativeID
425424
}
426425
}
427426
}];
427+
#endif /* !TARGET_OS_TV */
428428
}
429429

430430
- (void)setDefaultInputAccessoryView
431431
{
432+
#if !TARGET_OS_TV
432433
UIView<RCTBackedTextInputViewProtocol> *textInputView = self.backedTextInputView;
433434
UIKeyboardType keyboardType = textInputView.keyboardType;
434435

@@ -467,6 +468,7 @@ - (void)setDefaultInputAccessoryView
467468
textInputView.inputAccessoryView = nil;
468469
}
469470
[self reloadInputViewsIfNecessary];
471+
#endif /* !TARGET_OS_TV */
470472
}
471473

472474
- (void)reloadInputViewsIfNecessary

0 commit comments

Comments
 (0)