Skip to content

Drag with onPressIn not working with scrollable list on Android #467

@iRockE

Description

@iRockE

Describe the bug
Dragging often does not work as expected on Android when the list is large enough to scroll (I am using Android 13 on a Pixel 4a).

When there are enough elements in the list to enable scrolling and I scroll to the middle of the scrollview, then start dragging an item with onPressIn immediately after pressing down, the screen will scroll slightly, the item may move a little, and isActive will be set to true for that item. Then after .25 seconds or so as I try to move up/down the screen, neither the screen scrolls nor the item drags. If I release the press, isActive is still set to true for that item and the item is stuck mid-transition in the ui. If I press down again anywhere on the screen and start moving, that item will start moving again and then de-activate properly on the next release.

The above behavior happens nearly every time if I start moving immediately after pressing down. I've gotten it to happen with onLongPress as well, but it's more obvious/reproducable with onPressIn.

The versions noted below are for my app, although I am able to reproduce this bug with the following snack on Android, which has the same package versions as the example snack from this repo. I am using the nestable list so I used that in the snack.

To Reproduce
Snack

Platform & Dependencies
Please list any applicable dependencies in addition to those below (react-navigation etc).

  • react-native-draggable-flatlist version: 4.0.1
  • Platform: Pixel 4a, Android 13
  • React Native version: 0.71.3 (not Expo managed)
  • Reanimated version: 2.14.4
  • React Native Gesture Handler version: 2.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions