Skip to content

Row reordering (drag-and-drop / programmatic) #1341

Description

@jbetancur

Summary

Add the ability to reorder rows, both interactively (drag-and-drop) and programmatically, mirroring the existing column reordering capability.

Motivation

The library already supports column reordering. Row reordering is a common companion requirement: manual priority ordering, building ordered lists/queues, arranging steps, etc. There is currently no first-class way to do it.

Proposed API (for discussion)

  • draggableRows?: boolean — enable drag-to-reorder on rows.
  • onRowOrderChange?: (nextData, { from, to, row }) => void — fired after a reorder; consumer owns the data array and updates state.
  • Optional drag handle column / handle affordance rather than whole-row drag, to avoid conflicts with row click / selection.

Considerations

  • Interaction with selectableRows, expandable rows, and row click handlers (drag vs. click disambiguation).
  • Interaction with sorting: reordering only makes sense against an unsorted / manual order; decide whether enabling drag disables sort or reorders the underlying array.
  • Pagination: whether drag can move a row across pages.
  • Accessibility: keyboard-based reordering (move up/down), ARIA grabbed/dropeffect semantics.
  • RTL support (consistent with recent column reorder RTL fix).
  • Compose with column pinning and the planned native row pinning (Native sticky-on-scroll row pinning (pinnedRows / pinnedRowIds) #1340).

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions