minop1205 / react-dnd-treeview

A draggable / droppable React-based treeview component. You can use render props to create each node freely.
MIT License
516 stars 69 forks source link

Manual sort with multiple drag #180

Open Daniel-Valente opened 1 year ago

Daniel-Valente commented 1 year ago

Is your feature request related to a problem? Please describe.

I have started using this component and I have a question about its use the more I try it. I try to use the manual sort together with the multiple drag, I see that you can easily move the nodes into each other using the multiple drag, but if I try to use the manual sort with multiple selection, it only sorts the last selected node. I don't know if it is possible to use the multiple drag with the manual sort and have it work, I'm not sure if an additional configuration is needed or just the one presented in the documentation would work.

manual-sort-with-multiple-drag

Describe alternatives you've considered I cannot find another way of doing what I'm after. Any solution that would allow the correct position bout all node would be fine

abrman commented 1 year ago

I'm pretty sure you could sort this out within the <Tree onDrop={handleDrop} /> property. Are you able to provide a codesandbox example of what you got so far?