Closed MarksCode closed 1 year ago
You can use an Controlled Environment instead of an uncontrolled environment, there you can define the drop logic yourself. You can use the drop implementation of the uncontrolled environment as an example (the uncontrolled environment react component is just a wrapper around the controlled environment, so technically you can just copy its implementation and change the drag logic).
But the use case is definitely justified, I don't have time to look into this this week, but will look into this soon if it makes sense to support this straight from the library.
Thanks @lukasbach. I will wait until you implement this feature to continue transitioning my company's file-picker to use this library.
Hey @lukasbach. Just wondering if you have any estimate for this feature. Thanks!
Hey, sorry didn't get to look into this recently, but added this today and released this as of 2.1.0.
Looks like there's a bug if you drop a folder onto a child folder, both of them will disappear.
I want to let the user drag and drop a node onto any other node, but if the target node is not a folder, the target should instead be the target node's parent (This is how most file-pickers work). Unfortunately setting
canDropOnNonFolder
totrue
causes the uncontrolled tree environment to attempt rendering the dragged node as a child of the non-folder target node, so this doesn't work.Does anyone know if this sort of behavior is possible?