Skip to content

Incorrect Momentum Scroll Events fired on Android #18568

@AbdallaElabd

Description

@AbdallaElabd

This is being reproduced with the latest Expo SDK version 25, which uses React Native 52. But I haven't seen any fixes in the changelog since that so I'm assuming it's still happening.

The momentum scroll on Android are firing before the momentum actually ends. Contrary to iOS, which behaves as it should.

Environment

Environment:
OS: macOS High Sierra 10.13.2
Node: 6.12.3
Yarn: 1.5.1
npm: 3.10.10
Watchman: 4.7.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
react: 16.2.0 => 16.2.0
react-native: https://github.com/expo/react-native/archive/sdk-25.0.0.tar.gz => 0.52.0

Steps to Reproduce

A snack to reproduce the issue: https://snack.expo.io/@abdallamohamed/onmomentumscroll-bug-on-android

Expected Behavior

Here's how it behaves on iOS:
During a momentum scroll, if you start another scroll:

  1. An onScrollDragBegin is fired.
  2. When the user lifts their finger, an onScrollDragEnd is fired.
  3. An onMomentumScrollBegin is fired and the scrollview starts scrolling.
  4. When it finally stops, an onMomentumScrollEnd is fired.

scroll-ios

Actual Behavior

  1. An onScrollDragBegin is fired.
  2. When the user lifts their finger, an onScrollDragEnd is fired.
  3. An onMomentumScrollBegin is fired, followed instantly by 2onMomentumScrollEnd events.
  4. The scrollview keeps scrolling and it finally stops.

scroll-android

Metadata

Metadata

Assignees

No one assigned

    Labels

    Platform: AndroidAndroid applications.StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions