nuclearpasta / react-native-drax

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

Is it possible to have a DraxList with valid drag&drop target items? #129

Open StCyr opened 2 years ago

StCyr commented 2 years ago

I have a DraxScrollView that I would like to turn into a DraxList to be able to re-order items in it.

But these items should also be valid drag&drop targets for items from another DraxScrollView. And, for some reason, as soon as I turn the DraxScrollView into a DraxList, the item's onReceiveDragDrop event handler stops working.

Is it a known limitation?

lafiosca commented 2 years ago

Hello there, and sorry for the delayed response. I think this could probably be considered a limitation although there may be some hacky way to accomplish it. It's been a while since I've had time to dig through the logic, but it's likely the DraxList is overriding the event handling for the items in it. There may be some trickery you can do with the props that enable/disable drags and reorders based onstate. Please see the conversations in #75 and #71 for potentially relevant discussions. For now I will leave this issue open as an enhancement request, although it may be a duplicate or at least overlap with #75. If you find a way to make your use case work, please comment here with the details of what you find. I'm sorry I cannot be of more help right now.

StCyr commented 2 years ago

If you find a way to make your use case work, please comment here with the details of what you find

Sure, I'll do.

Thanks for your software ❤️