diff --git a/Libraries/Text/TextInput/RCTBaseTextInputView.m b/Libraries/Text/TextInput/RCTBaseTextInputView.m index d9b0d7310d818f..e854f4fda54ee7 100644 --- a/Libraries/Text/TextInput/RCTBaseTextInputView.m +++ b/Libraries/Text/TextInput/RCTBaseTextInputView.m @@ -392,6 +392,16 @@ - (BOOL)textInputShouldChangeTextInRange:(NSRange)range replacementText:(NSStrin notifyDelegate:YES]; [self textInputDidChange]; + + _nativeEventCount++; + + if (_onChange) { + _onChange(@{ + @"text": _predictedText, + @"target": self.reactTag, + @"eventCount": @(_nativeEventCount), + }); + } } return NO; @@ -417,6 +427,16 @@ - (BOOL)textInputShouldChangeTextInRange:(NSRange)range replacementText:(NSStrin @"eventCount": @(_nativeEventCount), }); } + + _nativeEventCount++; + + if (_onChange) { + _onChange(@{ + @"text": _predictedText, + @"target": self.reactTag, + @"eventCount": @(_nativeEventCount), + }); + } return YES; } @@ -439,16 +459,6 @@ - (void)textInputDidChange // JS will assume the selection changed based on the location of our shouldChangeTextInRange, so reset it. [self textInputDidChangeSelection]; } - - _nativeEventCount++; - - if (_onChange) { - _onChange(@{ - @"text": self.attributedText.string, - @"target": self.reactTag, - @"eventCount": @(_nativeEventCount), - }); - } } - (void)textInputDidChangeSelection