lukasbach / react-complex-tree

Unopinionated Accessible Tree Component with Multi-Select and Drag-And-Drop
https://rct.lukasbach.com
MIT License
953 stars 77 forks source link

Important Bug with ControlledEnvironment and Drag&Drop. #105

Closed gpisano97 closed 1 year ago

gpisano97 commented 2 years ago

Discussed in https://github.com/lukasbach/react-complex-tree/discussions/104

Originally posted by **gpisano97** July 19, 2022 Hello, i'm using your component on React,js (17). I'm working with a big tree (with many nested children), and (with my team mates) we implemented a Controlled Environment (because we need to add and remove items), but the drag and drop logic is broken. We have filled the onDrop event and the "putting an item inside another" mechanism works. If we don't expand any Item also the reordering mechanism works, buf if we expand some Items and we try to move some child became all broken! The "target" element is wrong and in some cases (with the elements on bottom of the tree) also the "item" array is wrong!!! On "bestofreactjs.com" there is the issue #15, and seems to be similar. We are in trouble, this problems is making lose a big amount of time! How can we fix it ? Thanks all for the answers. Best Regards.
lukasbach commented 2 years ago

As @madhums mentioned in the discussion, it would be helpful to see a codesandbox as an example of the specific issue, or some other details what makes the element wrong and under what circumstances this behavior can be reproduced.

lukasbach commented 1 year ago

I'll close this as I don't have any actionable details on this. Please note that I recently fixed some issues regarding dnd targets, which will be released in the following days, so there is a chance that might be fixed alongside this release.