nuclearpasta / react-native-drax

A drag-and-drop system for React Native
MIT License
554 stars 69 forks source link

Is it possible to let DraxList only start dragging when pressing certain buttons? #116

Open hysasuke opened 3 years ago

hysasuke commented 3 years ago

I'm making a List of groups and each group has its own members. I need to let users drag to sort the groups and the members. So, I'm trying to using DraxList to accomplish that requirement. However, when I try to drag the members, the DraxList will response to the gesture and start to drag the entire group. So, I'm wondering, is it possible to make a button that DraxList only response to the button being pressed and then start to drag the group? Thanks a lot!

lafiosca commented 3 years ago

Hello @hysasuke, I don't know if there's a way to make this work with the current library. I thought someone else had opened a similar issue and found their own workaround, but I can't seem to find that. The only thing I can think of off the top of my head is to see if you can use a viewPropsExtractor to dynamically change the draggable value of the items, but I don't expect that will play nicely mid-gesture. If you do find a way to make this work with the existing library, please share the info here. For now I will leave this issue open as a feature request.

lafiosca commented 3 years ago

More generally, this and other issues have made me realize it would be nice to have some clarity (and potentially explicit overridability) for gesture priority when there are nested draggable items.

hysasuke commented 3 years ago

More generally, this and other issues have made me realize it would be nice to have some clarity (and potentially explicit overridability) for gesture priority when there are nested draggable items.

That would be great, thanks a lot!