Skip to content

Conversation

theearlofsandwich
Copy link

This PR adds the ability to drag and drop between multiple trees. It passes a reference to the drag tree on drop so you have access to what's being dropped. Works for both controlled and uncontrolled trees. I've updated the showcase demo pages to include a cross-tree demo and added some basic info into the readme.md.

There are some new tree properties, namely:

id?: string
allowCrossTreeDrop?: boolean;
allowCrossTreeDrag?: boolean;

and data handlers
onCrossTreeAdd?: handlers.CrossTreeAddHandler;
onCrossTreeDelete?: handlers.CrossTreeDeleteHandler;

I had to comment out the drop test code as drop now requires a reference to the initial drag tree.

Hope this code helps - it's probably not the most elegant but it does work and is reasonably comprehensive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant