dnd-kit
dnd-kit copied to clipboard
Multiple `useSortable` within an `DndContext`
Hi everyone, I am working on building a tree component. Therefore I already checked the tree example und multiple container example. I want to edit the tree and therefore I have made an edit view where you can see the tree on the left side and a table with entries on the right side.
I now want to drag&drop entries from the table into the tree. This is nearly working but now I face following issue:
- Currently the
IDof the leftuseSortable(tree compionent) is the same as of the rightuseSortable(table component). Due to the Docs theIDneed to be unique. - Having the same
IDis also trouble when I want to drag an element of the tree and the sameIDis listed in the table on the right side. - I tried to just to create a new
IDwithin theDragStartEvent. But doing this will cause different other issues.
I believe dnd-kit will need that the e.active.id (from any event) is the same ID as of the object that I create in the tree. Otherwise he will lose the information, that I am still dragging the object.
Is anyone able to confirm my assumption? Does anyone have an idea how to solve this?