iTwin / iTwinUI

A design system for building beautiful and well-working web interfaces.
https://itwin.github.io/iTwinUI/
MIT License
105 stars 38 forks source link

Reordering (drag) functionality in Tree component #2222

Open nimam-bentley opened 1 week ago

nimam-bentley commented 1 week ago

Feature

Drawing Production team has come across a need for a sortable Tree component for authoring capabilities to reorder Sheet Index structures. This would be drag and drop of nodes between any level of containers.

Examples

Ive used the antd library (example of draggable) to implement it for our use.

I can share the logic I used to identify the node being dragged and the parent of whats dropped, if that helps.

Heres a sample of my usage

mayank99 commented 1 week ago

@nimam-bentley Thanks for opening this issue. Just to confirm, when you say "sortable", you're talking about reordering, right?

Our Tree is fully customizable, so you should be able to use it with a third-party library until we natively support reordering. I would recommend looking at more well-researched solutions like React Aria, rather than Antd.

nimam-bentley commented 1 week ago

@mayank99 yes reordering.

Thanks for the suggestion, if reordering is not natively supported by the time we publish our component I'll consider changing to React Aria.