scrollTo function does not trigger onMomentumScrollBegin and onMomentumScrollEnd
See original GitHub issue- I have reviewed the documentation
- I have searched existing issues
- [x ] I am using the latest React Native version
Having a vectical ScrollView and testing it on Android. If I called scrollview.scrollTo(x:0, y: y`, animated:true) by pressing a button, onMomentumScrollBegin is not called at the start and onMomentumScrollEnd is not called at the end of the automated scrolling.
Environment
Environment: OS: Windows 10 Node: 8.11.0 Yarn: 1.5.1 npm: 5.8.0 Watchman: Not Found Xcode: N/A Android Studio: Not Found
Packages: (wanted => installed) react: ^16.3.1 => 16.3.1 react-native: ^0.55.4 => 0.55.4
Steps to Reproduce
Don’t forget to look at the Log console to see the result.
https://snack.expo.io/@gagnondorf/scrollto-does-not-trigger-onmomentumscrollbegin-end
<div data-snack-id="@gagnondorf/scrollto-does-not-trigger-onmomentumscrollbegin-end" data-snack-platform="android" data-snack-preview="true" data-snack-theme="dark" style="overflow:hidden;background:#212733;border:1px solid rgba(0,0,0,.08);border-radius:4px;height:505px;width:100%"></div> <script async src="https://snack.expo.io/embed.js"></script>Expected Behavior
When scrollTo is called, OnMomentumScrollBegin should be called at the begining and OnMomentumScrollEnd should be called when the auto-scrolling is over.
Description of thoses methods in React-Native docs: onScroll Fires at most once per frame during scrolling. The frequency of the events can be controlled using the scrollEventThrottle prop.
onMomentumScrollBegin Called when the momentum scroll starts (scroll which occurs as the ScrollView glides to a stop).
onMomentumScrollEnd Called when the momentum scroll ends (scroll which occurs as the ScrollView glides to a stop).
Actual Behavior
If the user do not drag with his finger before ScrollTo is called, then onMomentumScrollBegin and onMomentumScrollEnd are not called during the automated scrolling. If the user is dragging, sometimes those functions are triggers.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:5
I have the same issue for android of RN@0.55.4.
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.