Permalink
Browse files

Fixed TVOS test failure caused by input accessory view change

Reviewed By: mmmulani

Differential Revision: D7103353

fbshipit-source-id: 7a1575eff0296017521fc8ca6fe384301849a73e
  • Loading branch information...
PeteTheHeat authored and facebook-github-bot committed Feb 28, 2018
1 parent 2dd2529 commit 6d9fe455dc815cdce86c00f81c71c9ca0c724964
Showing with 4 additions and 2 deletions.
  1. +4 −2 Libraries/Text/TextInput/RCTBaseTextInputView.m
@@ -402,17 +402,16 @@ - (void)didMoveToWindow
- (void)didSetProps:(NSArray<NSString *> *)changedProps
{
#if !TARGET_OS_TV
if ([changedProps containsObject:@"inputAccessoryViewID"] && self.inputAccessoryViewID) {
[self setCustomInputAccessoryViewWithNativeID:self.inputAccessoryViewID];
} else if (!self.inputAccessoryViewID) {
[self setDefaultInputAccessoryView];
}
#endif
}
- (void)setCustomInputAccessoryViewWithNativeID:(NSString *)nativeID
{
#if !TARGET_OS_TV
__weak RCTBaseTextInputView *weakSelf = self;
[_bridge.uiManager rootViewForReactTag:self.reactTag withCompletion:^(UIView *rootView) {
RCTBaseTextInputView *strongSelf = weakSelf;
@@ -425,10 +424,12 @@ - (void)setCustomInputAccessoryViewWithNativeID:(NSString *)nativeID
}
}
}];
#endif /* !TARGET_OS_TV */
}
- (void)setDefaultInputAccessoryView
{
#if !TARGET_OS_TV
UIView<RCTBackedTextInputViewProtocol> *textInputView = self.backedTextInputView;
UIKeyboardType keyboardType = textInputView.keyboardType;
@@ -467,6 +468,7 @@ - (void)setDefaultInputAccessoryView
textInputView.inputAccessoryView = nil;
}
[self reloadInputViewsIfNecessary];
#endif /* !TARGET_OS_TV */
}
- (void)reloadInputViewsIfNecessary

0 comments on commit 6d9fe45

Please sign in to comment.