Skip to content

Support coordinating the tree with an external DndContext #396

Open

Description

@ccombe

Problem

v5 gives each tree its own <DndContext> (see #391). Apps that want to coordinate several trees, or a tree plus their own droppables, inside one <DndContext> cannot do so today. The obvious approaches are unsafe: draggable and droppable IDs are raw node.ids and collide across trees, and a shared useDndMonitor delivers every drag to every tree.

Proposed change

  • Namespace draggable and droppable IDs per tree instance.
  • Filter monitor events to the tree's own draggables.
  • Add an explicit, supported way to opt into a parent context (no detection of dnd-kit internals).
  • Re-expose a collision-detection helper if needed.

Acceptance

  • Two trees in one <DndContext> reorder independently with no cross-talk.
  • A tree plus the app's own droppables do not collide.

Follow-up from the #391 review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions