# RowDragDropConfig

> _Since v2.4.0_

Configuration for RowDragDropPlugin.

All keys not annotated as "cross-grid" are identical in name and default to
`RowReorderConfig`, so migration is `new RowReorderPlugin(cfg)` →
`new RowDragDropPlugin(cfg)` with zero changes.

## Properties

| Property | Type | Description |
| -------- | ---- | ----------- |
| `enableKeyboard?` | <code>boolean</code> | Enable keyboard shortcuts (`Ctrl + ↑` / `Ctrl + ↓`) for moving rows. Keyboard moves are intra-grid only. |
| `showDragHandle?` | <code>boolean</code> | Show a drag handle column. |
| `dragFrom?` | <code>row &#124; handle &#124; both</code> | Where on a row a drag can be initiated. |
| `dragHandlePosition?` | <code>left &#124; right</code> | Position of the drag handle column. |
| `dragHandleWidth?` | <code>number</code> | Width of the drag handle column in pixels. |
| `debounceMs?` | <code>number</code> | Debounce time in milliseconds for rapid keyboard moves. Events are batched and emitted after this delay. |
| `animation?` | <code>false &#124; flip</code> | Animation type for row movement. - `false`: instant reorder - `'flip'`: FLIP animation (slides rows smoothly) |
| `canDrag?` | <code>(row: T, index: number) =&gt; boolean</code> | Validation callback invoked once at `dragstart` (and on intra-grid keyboard moves) to decide whether a row can be picked up. Replaces `RowReorderConfig.canMove` for the dragstart side. |
| `canMove?` | <code>(row: T, fromIndex: number, toIndex: number, direction: up &#124; down) =&gt; boolean</code> | ⚠️  |
| `dropZone?` | <code>string</code> | Shared zone identifier. Two grids that opt into the same zone may exchange rows. Omit to behave exactly like the legacy `RowReorderPlugin` — intra-grid only, no cross-grid affordances. |
| `operation?` | <code>copy &#124; move</code> | Cross-grid drop semantics. - `'move'` (default): the row is removed from the source grid's `_rows`   and inserted into the target. - `'copy'`: the source `_rows` is unchanged; the target inserts a copy. |
| `canDrop?` | <code>(payload: <a href="/grid/plugins/row-drag-drop/interfaces/rowdragpayload/">RowDragPayload</a>&lt;T&gt;, targetIndex: number) =&gt; boolean</code> | Validation callback invoked during `dragover` (same-window) and at drop time to decide whether a drop should be accepted at `targetIndex`. |
| `serializeRow?` | <code>(row: T) =&gt; unknown</code> | Optional row transformer applied when a row leaves this grid in a cross-window / cross-iframe drag (i.e. when the WeakRef live-reference path cannot be used). Use to strip internal IDs or rename fields before the row crosses a security boundary. |
| `deserializeRow?` | <code>(raw: unknown) =&gt; T</code> | Optional row transformer applied when a row lands in this grid via a cross-window / cross-iframe drag. Use to assign new IDs or remap fields. |
| `autoScroll?` | <code>boolean &#124; object</code> | Auto-scroll the target grid when the cursor approaches its viewport top or bottom edge during drag. |

### Property Details

#### enableKeyboard

**Default:** `true`

---

#### showDragHandle

Show a drag handle column.

Defaults to `true` when dragFrom is
`'handle'` (the default) or `'both'`, and to `false` when `dragFrom` is
`'row'` — when the entire row is the drag handle, the dedicated grip
column adds no value. Set explicitly to override.

**Default:** `true (or false when `dragFrom: 'row'`)`

---

#### dragFrom

Where on a row a drag can be initiated.

- `'handle'` (default): only the grip column starts a drag. Backwards
  compatible with `RowReorderPlugin`.
- `'row'`: any cell starts a drag, and the grip column is hidden by
  default. Recommended for transfer-list / kanban-style UIs where a
  dedicated handle adds visual noise.
- `'both'`: either the grip OR any cell starts a drag.

Drags initiated on interactive descendants (inputs, buttons, anchors,
contenteditable, open cell editors, selection checkboxes) are always
suppressed regardless of this setting so native interactions keep working.

**Default:** `'handle'`

---

#### dragHandlePosition

**Default:** `'left'`

---

#### dragHandleWidth

**Default:** `40`

---

#### debounceMs

**Default:** `150`

---

#### animation

**Default:** `'flip'`

---

#### operation

Cross-grid drop semantics.
- `'move'` (default): the row is removed from the source grid's `_rows`
  and inserted into the target.
- `'copy'`: the source `_rows` is unchanged; the target inserts a copy.

The user's input `sourceRows` array is never mutated on either side —
persistence is consumer-driven via the `row-transfer` event.

**Default:** `'move'`

---

#### autoScroll

Auto-scroll the target grid when the cursor approaches its viewport top
or bottom edge during drag.

- `true` (default): enable with the default tuning
  (`edgeSize: 60`, `speed: 8`, `maxSpeed: 24`).
- `false`: disabled.
- object: overrides any of the tuning fields.

**Default:** `true`

---
