react-dnd-treeview
react-dnd-treeview copied to clipboard
Add missing indexes to canDrop
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!