New to KendoReactStart a free 30-day trial

Keyboard Navigation
Premium

Managing the Focus

The PivotGrid component is a container that consists of two logically separated structural elements:

  • Data Grid (role="grid");
  • Configurator (role="dialog");

Opening and closing the Configurator is controlled through dedicated shortcuts, and focus is trapped in the respective section once an element inside it gets focused. Closing the Configurator returns focus to the Data Grid.

Data Grid Focus

The Data Grid is a single tab stop component. Upon focusing the Data Grid, the initial focus is set to either the previously focused cell (if any), or the first data (<td>) cell in the Data Grid. The change of the focused cell should be implemented using one of the following two techniques:

  • Roving TabIndex components Practice for managing the focus. Meaning that going through the cells will update the tabindex of the cell.
  • Active descendant - keeping the focus always on the Data Grid and using the aria-activedescendant on the Data Grid element which points to the id of the currently focused cell.
  • When the Configurator is available, opening it moves the focus to the first focusable element inside. The focus is trapped and wrapped, meaning the focusable components inside will follow their natural tab index, and when the last/first element is reached Tab/Shift-Tab will focus the first/last element respectively.
  • Pressing Escape while the Configurator is opened and contains the focus, closes the Configurator panel and returns focus to the last focused PivotGrid cell or the first cell if no PivotGrid cell was previously focused.

Keyboard Shortcuts

All Grid cells

ShortcutBehavior
Right ArrowMoves focus one cell to the right (if any)
Left ArrowMoves focus one cell to the left (if any)
Down ArrowMoves focus one cell down (if any)
Up ArrowMoves focus one cell up (if any)
HomeMoves focus to the first cell in the row that contains focus.
EndMoves focus to the last cell in the row that contains focus.
Ctrl/Cmd(Mac) + HomeMoves focus to the first (top-left) data cell in the grid.
Ctrl/Cmd(Mac) + EndMoves focus to the last cell in the last row of the Grid.
oOpens the configurator when available.
EscapeCloses the configurator when available and open.

Grid header cells

ShortcutBehavior
Enter & SpaceIf the header cell is expandable, toggles the current expanded state.

Configurator*

ShortcutBehavior
EscapeCloses the Configurator and returns focus to the last focused PivotGrid table cell (or the first cell).
TabFocuses the next focusable element or the first focusable element, if the focus is on the last focusable element.
Shift + TabFocuses the previous focusable element or the last focusable element, if the focus is on the first focusable element.
Backspace & DeleteApplicable when a Chip is focused. Removes the Chip, and the previous focusable element is focused.
Ctrl/Cmd(Mac) + Shift + Left/Right ArrowApplicable when a Chip is focused. Switches the Chip with the next/previous one from the same section (if one is available).
Ctrl/Cmd(Mac) + Shift + Up/Down ArrowApplicable when a Chip is focused. Moves a Chip from the Rows section to the Columns one or vice-versa.
Alt/Opt(Mac) + Down ArrowOpens the Chip menu for the focused Chip. Focus goes to the first menu element is trapped in the menu popup.

Configurator Chip Menu*

ShortcutBehavior
EscapeCloses the menu and returns the focus to the Chip that triggered it.
TabFocuses the next focusable menu element or the first focusable element, if the focus is on the last focusable element.
Shift + TabFocuses the previous focusable element or the last focusable element, if the focus is on the first focusable element.
EnterTriggers the default action associated with the focused menu item.

* All inner Confurator and Chip Menu components follow their own keyboard navigation behavior when focused.

Resources

ARIA Authoring Practices: Grid Pattern

ARIA Authoring Practices: Data Grid

See Also