Permalink
Browse files

RCTTextInput: Fixed problem with accessory view & 3rd party libs

Summary:
Now RCTTextInput relies on ivar to detect should it reconstruct inputAccessoryView or not.
Previously we checked `inputAccessoryView` directly which breaks some 3rd party libs.

See #16071 for more details.
cc douglasjunior

Reviewed By: javache

Differential Revision: D5994798

fbshipit-source-id: c086efdd24f5528393a4c734ff7c984e0ed740d1
  • Loading branch information...
shergin authored and facebook-github-bot committed Oct 9, 2017
1 parent 5e25c0e commit bf3698323d81508fc77174df2b1ffe5fb03224e7
Showing with 4 additions and 3 deletions.
  1. +4 −3 Libraries/Text/RCTTextInput.m
@@ -21,6 +21,7 @@
@implementation RCTTextInput {
CGSize _previousContentSize;
BOOL _hasInputAccesoryView;
}
- (instancetype)initWithBridge:(RCTBridge *)bridge
@@ -304,12 +305,12 @@ - (void)invalidateInputAccessoryView
) &&
textInputView.returnKeyType == UIReturnKeyDone;
BOOL hasInputAccesoryView = textInputView.inputAccessoryView != nil;
if (hasInputAccesoryView == shouldHaveInputAccesoryView) {
if (_hasInputAccesoryView == shouldHaveInputAccesoryView) {
return;
}
_hasInputAccesoryView = shouldHaveInputAccesoryView;
if (shouldHaveInputAccesoryView) {
UIToolbar *toolbarView = [[UIToolbar alloc] init];
[toolbarView sizeToFit];

0 comments on commit bf36983

Please sign in to comment.