Skip to content

Commit bf36983

Browse files
sherginfacebook-github-bot
authored andcommitted
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
1 parent 5e25c0e commit bf36983

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

Libraries/Text/RCTTextInput.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
@implementation RCTTextInput {
2323
CGSize _previousContentSize;
24+
BOOL _hasInputAccesoryView;
2425
}
2526

2627
- (instancetype)initWithBridge:(RCTBridge *)bridge
@@ -304,12 +305,12 @@ - (void)invalidateInputAccessoryView
304305
) &&
305306
textInputView.returnKeyType == UIReturnKeyDone;
306307

307-
BOOL hasInputAccesoryView = textInputView.inputAccessoryView != nil;
308-
309-
if (hasInputAccesoryView == shouldHaveInputAccesoryView) {
308+
if (_hasInputAccesoryView == shouldHaveInputAccesoryView) {
310309
return;
311310
}
312311

312+
_hasInputAccesoryView = shouldHaveInputAccesoryView;
313+
313314
if (shouldHaveInputAccesoryView) {
314315
UIToolbar *toolbarView = [[UIToolbar alloc] init];
315316
[toolbarView sizeToFit];

0 commit comments

Comments
 (0)