-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
Scroll Bug in NestableScrollContainer #497
Comments
+1 |
I am having the same issue. The frequency of the bug seems do decrease as the value of the activationDistance prop increases |
This seems to be caused by the This issue in the |
I was able to find a workaround -> CarterSimonson#1 Here's what I ended up doing:
I initially tried controlling the This results in the following behavior:
This works but unfortunately required a breaking change to the API. Demo: 302495005-eaf49342-e18d-4a6a-beb7-2d97ab192ae8.mov |
Hi @CarterSimonson could you provide some of the code of how you got this working? It doesn't seem your PR fixed this issue by default or I think I'd be seeing my issue resolved unless I need to update react-native-gesture-handler library to the latest. Only solution I've found to this is increasing activationDistance by a gross amount and lowering it when dragging item |
Hey @SethCram, My goal was to only allow the elements to be dragged when a button on each of them was clicked and dragged: Here's a code snippet of the workaround from my component that wraps this drag button on each of my list items. The only change to the way the library is used is that a tapGesture from RN gesture handler is passed as an argument to
One limitation of this is that it doesn't prevent the scrolling bug if the entire list item is a clickable area (like it is in this demo). It takes advantage of the fact that I only needed to support drag events on a small section of each list item. Hopefully that clears some things up, I am happy to elaborate further if not 😄 |
This package has external dependencies of react-native-reanimated and react-native-gesture-handler which must be installed separately. Before opening an issue related to animations or gestures please verify that you have completed ALL installation steps, including the changes to MainActivity.
Describe the bug
When using NestableScrollContainer with react-native-draggable-flatlist, I noticed that if I try to scroll in a different direction while a scroll motion is still ongoing, it works fine. However, if I wait for the scroll to complete and then attempt to scroll again, depending on the gesture, it often fails to scroll.
To Reproduce
This issue can be reproduced in the official Snack: "https://snack.expo.dev/@computerjazz/draggable-flatlist-examples". Navigate to the "Nested" Screen. Try scrolling up and, before the scroll completes, scroll down (or vice versa). It works as expected. However, if you wait for the scroll to complete and then attempt to scroll again, you will encounter the issue.
Platform & Dependencies
Please list any applicable dependencies in addition to those below (react-navigation etc).
Additional context
I have also tried replacing NestableDraggableFlatList with a regular FlatList, and it worked without issues. This leads me to believe that the problem might be specific to NestableDraggableFlatList.
The text was updated successfully, but these errors were encountered: