diff --git a/Libraries/Text/RCTTextView.m b/Libraries/Text/RCTTextView.m index 01d6bb1ca3dec3..415c0df826b0c2 100644 --- a/Libraries/Text/RCTTextView.m +++ b/Libraries/Text/RCTTextView.m @@ -346,6 +346,8 @@ - (void)setContentInset:(UIEdgeInsets)contentInset [self updateFrames]; } +#pragma mark - UITextViewDelegate + - (BOOL)textView:(RCTUITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text { if (textView.textWasPasted) { @@ -646,6 +648,12 @@ - (void)textViewDidChange:(UITextView *)textView - (void)textViewDidEndEditing:(UITextView *)textView { + if (_nativeUpdatesInFlight) { + // iOS does't call `textViewDidChange:` delegate method if the change was happened because of autocorrection + // which was triggered by loosing focus. So, we call it manually. + [self textViewDidChange:textView]; + } + [_eventDispatcher sendTextEventWithType:RCTTextEventTypeEnd reactTag:self.reactTag text:textView.text @@ -711,6 +719,8 @@ - (UIColor *)defaultPlaceholderTextColor return [UIColor colorWithRed:0.0/255.0 green:0.0/255.0 blue:0.098/255.0 alpha:0.22]; } +#pragma mark - UIScrollViewDelegate + - (void)scrollViewDidScroll:(UIScrollView *)scrollView { if (_onScroll) {