diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm index c595e7af5d1..0443f1c2aa8 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm @@ -68,6 +68,8 @@ static NSSet *returnKeyTypesSet; * later comparison insensitive to them. */ NSDictionary *_originalTypingAttributes; + + BOOL _hasInputAccessoryView; } #pragma mark - UIView overrides @@ -610,10 +612,12 @@ static NSSet *returnKeyTypesSet; keyboardType == UIKeyboardTypeDecimalPad || keyboardType == UIKeyboardTypeASCIICapableNumberPad) && (containsKeyType || containsInputAccessoryViewButtonLabel); - if ((_backedTextInputView.inputAccessoryView != nil) == shouldHaveInputAccessoryView) { + if (_hasInputAccessoryView == shouldHaveInputAccessoryView) { return; } + _hasInputAccessoryView = shouldHaveInputAccessoryView; + if (shouldHaveInputAccessoryView) { NSString *buttonLabel = inputAccessoryViewButtonLabel != nil ? inputAccessoryViewButtonLabel : [self returnKeyTypeToString:returnKeyType];