Skip to content

Keyboard & accessibility ​

Keyboard navigation ​

Ctrl stands for ⌘ on macOS.

KeyAction
← → ↑ ↓move the focus (↑ / ↓ also focus group rows)
Ctrl + arrow keysmove the focus and add the cell to the selection (multi selection)
Tab / Shift + Tabnext / previous cell (wraps to the next row)
Page Up / Page Downone page up / down
Home / Endfirst / last cell of the row
Ctrl + Home / Endfirst / last cell of the grid
Shift + arrow keys, Page Up / Page Down, Home / Endextend the selection
Spacetoggle the selection of the row (row selection, Shift + Space selects a range) or start editing
Ctrl + Aselect all
Enterstart editing, expand / collapse tree rows which are not editable
F2start editing
any characterstart editing and replace the value with the typed character
Delete / Backspaceclear the editable cells of the selection (cell range, all cells of the selected rows or the focused cell)
Alt + ← / →collapse / expand tree rows
Ctrl + Ccopy the selection (clipboard)
Ctrl + Xcut: copy the selection and clear the editable cells
Ctrl + Vpaste at the focused cell
Ctrl + Zundo the last change (undo and redo)
Ctrl + Y / Ctrl + Shift + Zredo
Escapecancel column dragging or dragging the fill handle

Copy, cut and paste require the option clipboard, undo and redo the option undoRedo (both enabled by default). Delete, cut, paste and undo only change editable cells.

While editing ​

KeyAction
Enterfinish editing (with enterMovesDown: true the focus moves to the cell below, with Shift to the cell above)
Shift + Enternew line in a textarea editor
Tab / Shift + Tabfinish editing and edit the next / previous cell
Escapecancel editing

Group rows ​

When a group row (or a group footer) has the focus:

KeyAction
↑ / ↓previous / next row
→expand the group, move to the next row if it is expanded already
←collapse the group, move to the parent group if it is collapsed already
Enter / Spaceexpand / collapse the group
Home / Endfirst / last row of the grid

On a group footer the keys expand / collapse the group of the footer.

The focused cell always stays rendered and is scrolled into view.

Custom keyboard handling ​

Handle keys yourself with the onCellKeyDown callback and call preventDefault() to disable the default behavior:

vue
<Datagrid
  :events="{
    onCellKeyDown: (e) => {
      if (e.key === 'Delete') {
        e.preventDefault();
        deleteSelectedRows();
      }
    },
  }"
/>
tsx
<Datagrid
  events={{
    onCellKeyDown: (e) => {
      if (e.key === "Delete") {
        e.preventDefault();
        deleteSelectedRows();
      }
    },
  }}
/>

Accessibility ​

The grid follows the ARIA grid pattern:

  • role="grid", row, columnheader, gridcell and rowgroup
  • aria-rowcount, aria-colcount, aria-rowindex, aria-colindex (also for virtualized rows)
  • aria-sort on sortable headers
  • aria-selected for selected rows and cells, aria-multiselectable
  • aria-expanded and aria-level for tree and group rows
  • aria-busy while loading
  • a roving tabindex: only the focused cell is part of the tab order
  • labels for checkboxes, toggle buttons and filter inputs (localized)

Released under the ISC License.