Skip to content

Commit

Permalink
RCTTextInput: Fixed problem with accessory view & 3rd party libs
Browse files Browse the repository at this point in the history
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 bf36983
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Libraries/Text/RCTTextInput.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

@implementation RCTTextInput {
CGSize _previousContentSize;
BOOL _hasInputAccesoryView;
}

- (instancetype)initWithBridge:(RCTBridge *)bridge
Expand Down Expand Up @@ -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];
Expand Down

0 comments on commit bf36983

Please sign in to comment.