Fixed onScroll prop in mulitline TextInput (#23668)

Summary:
We lose the support of `onScroll` prop for multiline TextInput, let's add it again.

[iOS] [Fixed] - Fixed onScroll prop in mulitline TextInput
Pull Request resolved: https://github.com/facebook/react-native/pull/23668

Differential Revision: D14253996

Pulled By: cpojer

fbshipit-source-id: 43ed191e18fdb716f6c53be3bf0f59f917b34b59
This commit is contained in:
zhongwuzw
2019-02-27 18:21:51 -08:00
committed by Facebook Github Bot
parent abb82c472d
commit 3b3e6a0eb3
2 changed files with 13 additions and 0 deletions

View File

@@ -27,6 +27,10 @@ NS_ASSUME_NONNULL_BEGIN
- (void)textInputDidChangeSelection;
@optional
- (void)scrollViewDidScroll:(UIScrollView *)scrollView;
@end
NS_ASSUME_NONNULL_END

View File

@@ -213,6 +213,15 @@ static void *TextFieldSelectionObservingContext = &TextFieldSelectionObservingCo
[self textViewProbablyDidChangeSelection];
}
#pragma mark - UIScrollViewDelegate
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
if ([_backedTextInputView.textInputDelegate respondsToSelector:@selector(scrollViewDidScroll:)]) {
[_backedTextInputView.textInputDelegate scrollViewDidScroll:scrollView];
}
}
#pragma mark - Public Interface
- (void)skipNextTextInputDidChangeSelectionEventWithTextRange:(UITextRange *)textRange