Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Tree drag and drop #7692

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Conversation

rob-clayburn
Copy link
Contributor

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

  • 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.

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