react-native: Scrollview on Android does not call onMomentumScrollEnd when scrolled programmatically

This is a follow-up of #25672.

React Native version:

System: OS: macOS 10.14.6 CPU: (8) x64 Intel® Core™ i7-4850HQ CPU @ 2.30GHz Memory: 37.81 MB / 16.00 GB Shell: 5.0.9 - /usr/local/bin/bash Binaries: Node: 8.15.0 - ~/.nvm/versions/node/v8.15.0/bin/node Yarn: 1.19.0 - /usr/local/bin/yarn npm: 6.11.3 - ~/.nvm/versions/node/v8.15.0/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 13.0, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0 Android SDK: API Levels: 23, 25, 26, 28 Build Tools: 23.0.1, 25.0.1, 26.0.1, 26.0.2, 28.0.1, 28.0.3 System Images: android-23 | Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom IDEs: Android Studio: 3.5 AI-191.8026.42.35.5791312 Xcode: 11.0/11A420a - /usr/bin/xcodebuild npmPackages: react: 16.9.0 => 16.9.0 react-native: 0.61.1 => 0.61.1 npmGlobalPackages: react-native-cli: 2.0.1

Steps To Reproduce

  1. Call scrollTo({ x: something, y: something, animated: true})
  2. Watch how on Android the onMomentumScrollEnd isn’t being called, while in iOS works fine.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 8
  • Comments: 26 (6 by maintainers)

Most upvoted comments

Still an issue on react-native 0.66.4

Can verify it’s still happening in v0.61.5 on Android.

Confirm it still happens on react-native: 0.63.2.

Appears to still be an issue in 0.66.3

Hey @ajpaulingalls thanks for working on this. Could you open this PR to the main repo so I can take a look at it?

Hi @safaiyeh which repo do you mean by main repo? The PR is open against facebook:master. You can view it here:

https://github.com/facebook/react-native/pull/30367

do you have a different repo in mind?

Confirming it happens in react-native 0.65.1

@ajpaulingalls sadly not work with me :\ still not triggered! here’s my code snippet if u want to see it or something https://gist.github.com/anastely/0252cbe613bb0a5a6652fc498f0ce7d4

Can you verify you have the actual changes? Check for this file in your node_modules and validate it has the calls to handleSmoothScrollMomentumEvents();

https://github.com/ajpaulingalls/react-native/blob/release/paul-v2/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java

sometimes yarn/npm can be messy. I have verified the change both in my code as well as the RNTester app (both in 0.63.3 fork as well as master) so I’m confident it works…

Hey @ajpaulingalls thanks for working on this. Could you open this PR to the main repo so I can take a look at it?