From ee9926c16b8fd92e6075450e1750d00a1090e8bf Mon Sep 17 00:00:00 2001 From: Islam Rustamov Date: Sun, 16 Nov 2025 00:38:31 +0300 Subject: [PATCH] Fix excessive emits of keyboardDidShow event on iOS --- .../TextInput/RCTTextInputComponentView.mm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 d02e003a439e..4bfe658c3d4d 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm @@ -300,6 +300,13 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared & if (newTextInputProps.inputAccessoryViewID != oldTextInputProps.inputAccessoryViewID) { _backedTextInputView.inputAccessoryViewID = RCTNSStringFromString(newTextInputProps.inputAccessoryViewID); + + // InputAccessoryView component sets the inputAccessoryView when inputAccessoryViewID exists + if (_backedTextInputView.inputAccessoryViewID) { + if (_backedTextInputView.isFirstResponder) { + [_backedTextInputView reloadInputViews]; + } + } } if (newTextInputProps.inputAccessoryViewButtonLabel != oldTextInputProps.inputAccessoryViewButtonLabel) { @@ -639,9 +646,6 @@ - (void)setDefaultInputAccessoryView { // InputAccessoryView component sets the inputAccessoryView when inputAccessoryViewID exists if (_backedTextInputView.inputAccessoryViewID) { - if (_backedTextInputView.isFirstResponder) { - [_backedTextInputView reloadInputViews]; - } return; }