diff --git a/packages/react-native/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m b/packages/react-native/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m index 0542362dbe0ac6..1c8f8e055e8399 100644 --- a/packages/react-native/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +++ b/packages/react-native/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m @@ -256,21 +256,21 @@ - (BOOL)textView:(__unused UITextView *)textView shouldChangeTextInRange:(NSRang - (void)textViewDidChange:(__unused UITextView *)textView { - if (_ignoreNextTextInputCall && [_lastStringStateWasUpdatedWith isEqual:_backedTextInputView.attributedText]) { + if (_ignoreNextTextInputCall) { _ignoreNextTextInputCall = NO; return; } - _lastStringStateWasUpdatedWith = _backedTextInputView.attributedText; _textDidChangeIsComing = NO; [_backedTextInputView.textInputDelegate textInputDidChange]; } - (void)textViewDidChangeSelection:(__unused UITextView *)textView { - if (![_lastStringStateWasUpdatedWith isEqual:_backedTextInputView.attributedText]) { + if (_lastStringStateWasUpdatedWith && ![_lastStringStateWasUpdatedWith isEqual:_backedTextInputView.attributedText]) { [self textViewDidChange:_backedTextInputView]; _ignoreNextTextInputCall = YES; } + _lastStringStateWasUpdatedWith = _backedTextInputView.attributedText; [self textViewProbablyDidChangeSelection]; }