Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onScroll event not firing for multiline TextInput #20309

Closed
dereksweet opened this issue Jul 20, 2018 · 4 comments
Closed

onScroll event not firing for multiline TextInput #20309

dereksweet opened this issue Jul 20, 2018 · 4 comments
Labels
Component: TextInput Related to the TextInput component. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@dereksweet
Copy link

Environment

Environment:
OS: macOS High Sierra 10.13.4
Node: 6.9.0
Yarn: 1.6.0
npm: 3.10.8
Watchman: 4.9.0
Xcode: Xcode 9.4.1 Build version 9F2000
Android Studio: 2.3 AI-162.3934792

Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: ~0.55.2 => 0.55.4

Description

I noticed recently that multiline controls stopped firing the onScroll event when the user slides their thumb/finger to scroll the contents of the input. See the app linked in Reproducible Demo, it is as simple as can be. The console shows the output 'focusing' onFocus, but it does not display anything for onScroll.

Reproducible Demo

https://github.com/dereksweet/MultilineScrollTest

@react-native-bot react-native-bot added ⏪Old Version Component: TextInput Related to the TextInput component. labels Jul 20, 2018
@dereksweet
Copy link
Author

This is only an "Old Version" because I used the recommended create-react-native-app tool, I can verify that this problem still exists on 0.56.0

@react-native-bot
Copy link
Collaborator

I am closing this issue because it does not appear to have been verified on the latest release, and there has been no followup in a while.

If you found this thread after encountering the same issue in the latest release, please feel free to create a new issue with up-to-date information by clicking here.

@react-native-bot react-native-bot added the Ran Commands One of our bots successfully processed a command. label Aug 4, 2018
@zubko
Copy link
Contributor

zubko commented Jan 18, 2019

This issue is still happening on RN 0.57.8

Quick fix:

In node_modules/react-native/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m

Add

#pragma mark - UIScrollViewDelegate

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
  id<RCTBackedTextInputDelegate> delegate = _backedTextInputView.textInputDelegate;
  if ([delegate respondsToSelector:@selector(scrollViewDidScroll:)]) {
    [delegate performSelector:@selector(scrollViewDidScroll:) withObject:scrollView];
  }
}

@antonellil
Copy link

antonellil commented May 17, 2019

@zubko that fix works great. this seems worthy of a PR into RN to fix this? EDIT: looks like this has been added, disregard

@facebook facebook locked as resolved and limited conversation to collaborators Aug 4, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Aug 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Component: TextInput Related to the TextInput component. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants