Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm looking to get some feedback on this PR to add drag and drop to the Tree.
I am really really new to this codebase, and there are probably a ton of things I've not understood and have messed up
I've mainly just copied the logic from the listbox and applied it to the tree component.
There's a storybook story which I've added at http://localhost:9003/?path=/story/treeview--tree-example-dynamic-drag-n-drop&providerSwitcher-express=false&strict=true
Some things that would be great to get some feedback/help on are:
I'm unclear as to whether the dragAndDropHooks should be created by the user each time (e.g. in the story). Some things i can see being useful, but it feels like the reorder function shouldn't have to be implemented here. Is there a better place to put this?
Re-ordering works, but at some point it stops working. I can't seem to find a repeatable pattern of drag / drops to consistently replicate this though.
In storybook the hot reload gives an error:
![image](https://private-user-images.githubusercontent.com/195119010/408331712-2f1df73e-13c2-4282-9ccc-8f1319721243.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5MjQ4MjIsIm5iZiI6MTczODkyNDUyMiwicGF0aCI6Ii8xOTUxMTkwMTAvNDA4MzMxNzEyLTJmMWRmNzNlLTEzYzItNDI4Mi05Y2NjLThmMTMxOTcyMTI0My5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwN1QxMDM1MjJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iYjEwZTZkMGM4N2M2OGExOWNhNzMxNmU4NzMwNjhjZTk4NzdlYmJkZTFlZWRlYTc1MjRlYjQzMzNhYmZkOTZjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.3ONwKzna9uX-libdld3xHOoSQoITsC-vXrlRF08eXHk)
Although I've added the keyboard code - I've not yet tested that - was hoping to get the other issues ironed out first.
The way I've implemented the drop insert indicator causes the tree items to move which in turn can cause the drop to switch from before to after. The droppable listbox story renders items with a gap in between but I'm not sure if that is what is wanted in a tree view.