react-dnd-treeview icon indicating copy to clipboard operation
react-dnd-treeview copied to clipboard

Add missing indexes to canDrop

Open kristian-puccio opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe. I want to re-enact a feature like insertDroppableFirst but rather than forcing the order post drop not allowing dropping a non droppable item before the list of droppables (ie folders).

Describe the solution you'd like If the canDrop function included all the data that onDrop has relativeIndex and destinationIndex then I would have all the data required to enforce the ordering.

Describe alternatives you've considered insertDroppableFirst but that allows the drop and then re-orders.

Additional context I believe according to the docs canDrop should have the same parameters as onDrop.

This callback takes the same parameters as the onDrop callback, but the first parameter specifies the current tree.

Oh I'll have a go at making a PR for you.

Thanks!

kristian-puccio avatar Mar 31 '23 02:03 kristian-puccio