Skip to content

Add moveBefore and and moveAfter methods to useTreeData #5574

Open
@jamesopstad

Description

@jamesopstad

Provide a general summary of the feature here

useListData has the moveBefore and moveAfter methods, which are useful for working with drag and drop. It would be useful to have equivalents for useTreeData. This was mentioned in this PR #4444 but it was closed.

🤔 Expected Behavior?

This should work just like the moveBefore and moveAfter methods for useListData. The types would be the same:

moveBefore(key: Key, keys: Iterable<Key>): void
moveAfter(key: Key, keys: Iterable<Key>): void

😯 Current Behavior

These methods currently don't exist.

💁 Possible Solution

No response

🔦 Context

It is currently difficult to reorder items in tree structures, particularly when working with drag and drop. This feature would make this much easier.

💻 Examples

No response

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions