react-arborist
react-arborist copied to clipboard
Dragging parent into a child - critical issue
When a parent folder is being dragged into a child there is no check to prohibit this from happening. This causes the entire subtree to disappear.
Uh oh.
Well, there is code that prevents this from happening (ass you can see it in this demo, but there must be hole somewhere. Would you mind posting the options that you are passing to the <Tree> component? Also what version of the code are you on?
Since this is a controlled component, you'll be handing the "move" operation in your own code. You can make a check there. That can be a workaround until I discover the bug.
Try dragging a folder to the end of one of it's children. For example - House of Tully beneath Caitlin
I did implement a failsafe within my onmove function, but I guess it should be prohibited by the drag movement. The functionality that calculates the drop position - the blue underline.
Yup, I can reproduce. Thanks for reporting it. I'll find the bug now and fix it in the next release. I'm glad there's a workaround for you.