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 https://github.com/facebook/react-native/issues/16071 for more details. cc douglasjunior Reviewed By: javache Differential Revision: D5994798 fbshipit-source-id: c086efdd24f5528393a4c734ff7c984e0ed740d1
This commit is contained in:
parent
5e25c0e32f
commit
bf3698323d
|
@ -21,6 +21,7 @@
|
|||
|
||||
@implementation RCTTextInput {
|
||||
CGSize _previousContentSize;
|
||||
BOOL _hasInputAccesoryView;
|
||||
}
|
||||
|
||||
- (instancetype)initWithBridge:(RCTBridge *)bridge
|
||||
|
@ -304,12 +305,12 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)
|
|||
) &&
|
||||
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];
|
||||
|
|
Loading…
Reference in New Issue