Keyboard Navigation
The Kendo UI for Angular TreeList provides keyboard navigation support to enhance accessibility and improve user experience. Keyboard navigation is enabled by default to allow users to navigate through the TreeList sections, including the table, pager, and toolbar, using keyboard shortcuts. This feature is particularly useful for users who rely on keyboard navigation or assistive technologies.
Starting with Kendo UI for Angular v19.0.0, the TreeList keyboard navigation is enabled by default. To disable it, set the
navigableproperty tofalse.
Keyboard Shortcuts
The TreeList supports a variety of keyboard shortcuts to facilitate navigation and interaction with its elements. The shortcuts are designed to be intuitive and consistent with common keyboard navigation patterns.
The TreeList supports the following keyboard shortcuts:
| SHORTCUT | DESCRIPTION |
|---|---|
Right Arrow | Moves the focus one cell to the right. If the focus is on the right-most cell in the row, the focus does not move. |
Left Arrow | Moves the focus one cell to the left. If the focus is on the left-most cell in the row, the focus does not move. |
Down Arrow | Moves the focus one cell down. If the focus is on the bottom-most cell in the column, the focus does not move. |
Up Arrow | Moves the focus one cell up. If the focus is on the top-most cell in the column, the focus does not move. |
Page Down | Scrolls to the next page of data. If paging is configured, loads the next page of data, if any. If virtual scrolling is used, scrolls down with the number of visible items. |
Page Up | Scrolls to the previous page of data. If paging is configured, loads the previous page of data, if any. If virtual scrolling is used, scrolls up with the number of visible items. |
Home | Moves the focus to the first focusable cell in the row. |
End | Moves the focus to the last focusable cell in the row. |
Ctrl & Home | Moves the focus to the first cell in the first row. |
Ctrl & End | Moves the focus to the last cell in the last row. |
Ctrl/Cmd(MacOS) & Down Arrow | Moves the focus five cells down. If there are less than five cells until the end of the column, the focus does not move. |
Ctrl/Cmd(MacOS) & Up Arrow | Moves the focus five cells up. If there are less than five cells until the start of the column, the focus either does not move or goes to a cell in the header or the filter row. |
Alt & Right Arrow | Expands the current row, if applicable. |
Alt & Left Arrow | Collapses the current row, if applicable. |
Enter | Expands or collapses the current row, if pressed on an expandable, non-editable column; triggers the cell click action. |
Ctrl/Cmd(MacOS) + Shift + Up Arrow | Reorders the row with the previous row when such is present. |
Ctrl/Cmd(MacOS) + Shift + Down Arrow | Reorders the row with the next row when such is present. |
The TreeList column header cells support the following keyboard shortcuts:
| SHORTCUT | DESCRIPTION |
|---|---|
Enter | If the column is sortable, triggers the action associated with clicking the header cell - either sorts the data by the respective field, changes the sorting direction, or unsorts, depending on current state and configuration. |
Alt & Down Arrow | Opens the Filter or Column Menu when the respective header cell is focused. Traps the focus within the opened menu container. |
Ctrl & Space / Cmd & Enter(MacOS) | If the column is groupable, groups/ungroups the data by the column field. |
Ctrl/Cmd(MacOS) & Right Arrow | Reorders the column with the next one (if such is available). |
Ctrl/Cmd(MacOS) & Left Arrow | Reorders the column with the previous one (if such is available). |
When Selection is enabled, the TreeList supports the following shortcuts:
| SHORTCUT | DESCRIPTION |
|---|---|
Space | Selects the current row or cell. |
Ctrl & Space | Toggles the selection of the current row or cell. |
Shift & Space | Selects a range of rows or cells. |
Ctrl & A | Selects all rows or cells. |
Ctrl & Space / Cmd & Enter (MacOS) | Deselects the current row or adds the row to the existing selection. |
When a TreeList cell contains focusable components, the TreeList supports the following shortcuts:
| SHORTCUT | DESCRIPTION |
|---|---|
Enter | Disables the keyboard navigation of the TreeList and places the focus on the first widget. |
Escape | Restores the keyboard navigation of the TreeList. If the content was in the process of editing, the unsaved edits are removed. |
Tab | Moves the focus to the next focusable component in the current row. |
Shift & Tab | Moves the focus to the previous focusable component in the current row. |
| Alphanumeric keys | If the cell contains editable content, places the focus in an input field—for example, a textbox. |
The TreeList filter row supports the following keyboard shortcuts*:
| SHORTCUT | DESCRIPTION |
|---|---|
Enter | Enters in the td and focuses the first focusable element in it. All filter row components gain tabindex = 0. |
Arrow Keys | td elements receive focus as standard navigation in the TreeList. |
Tab | Goes forward through the filter row components. |
Shift + Tab | Goes backwards through the filter row components. |
The TreeList Pager supports the following keyboard shortcuts*:
| SHORTCUT | DESCRIPTION |
|---|---|
Enter | When the Pager wrapper is focused, moves the focus to the first focusable pager element. When an inner Pager element is focused, triggers the default action, associated with this element. |
Escape | When an inner Pager element is focused, brings the focus to the Pager wrapper. If the focused inner component has an open popup, Escape will close the popup. Pressing Escape again will focus the Pager wrapper. |
Tab | When an inner Pager element is focused, moves the focus between the focusable Pager elements sequentially. The focus is trapped and tabbing out of the last focusable element, focuses the first focusable element. |
Shift & Tab | When an inner Pager element is focused, moves the focus between the focusable Pager elements sequentially in reversed order. The focus is trapped and shift-tabbing out of the first focusable element, focuses the last focusable element. |
Left Arrow or Page Up | When the Pager wrapper is focused, loads the previous page of data, if any. |
Right Arrow or Page Down | When the Pager wrapper is focused, loads the next page of data, if any. |
Home | When the Pager wrapper is focused, loads the first page of data (if the current page is not the first one). |
End | When the Pager wrapper is focused, loads the last page of data (if the current page is not the last one). |
* All inner components within the Pager follow their own keyboard navigation behavior when focused.
The TreeList default toolbar supports the following keyboard shortcuts*:
| SHORTCUT | DESCRIPTION |
|---|---|
Left / Right Arrow | Focuses the previous / next focusable element in the toolbar. Focus is wrapped, meaning it will go from the last to first focusable element and vice-versa depending on the end user action. |
Tab | Focuses the next navigable TreeList section, or the next focusable element on the page. |
Shift + Tab | Focuses the previous navigable TreeList section, or the previous focusable element on the page. |
* All inner components within the toolbars follow their own keyboard navigation behavior when focused.
When using the ToolBar component instead the default toolbar, the TreeList supports the following keyboard shortcuts*:
| SHORTCUT | DESCRIPTION |
|---|---|
Left Arrow & Right Arrow | Moves the focus to the next available tool that can be focused. |
Enter | Clicks the currently active button or changes the state of the currently active toggleable button. |
Tab | Moves the focus to and from the ToolBar. |
Alt+Down Arrow | Opens the currently active SplitButton or DropDownButton. |
Alt+Up Arrow | Closes the currently active SplitButton or DropDownButton. |
Home | Moves focus to the first focusable tool. |
End | Moves focus to the last focusable tool. |
Escape | Closes the currently active SplitButton or DropDownButton. |
* All inner components within the toolbars follow their own keyboard navigation behavior when focused.
Focusing Custom Elements
The accessibility guidelines require that only one focusable element within the TreeList appears in the page Tab sequence.
The TreeList uses a roving tabindex to control which elements you can access through the Tab key. All other focusable elements receive a tabindex of "-1" and are excluded from the Tab sequence.
You must decorate all elements that can receive focus with the kendoTreeListFocusable directive. This directive registers the focusable elements with the TreeList and provides an interface for controlling their focused state and tabindex. You can apply the directive to regular input elements (such as inputs and buttons) and composite components (such as drop-down lists). The TreeList includes the focused element in the Tab sequence based on your actions. Typically, this element is one cell at a time, but when the TreeList is in editing mode, it can be an entire row.
You can move focus from cell to cell using the available shortcut keys. If a cell contains a single focusable element (such as a button or checkbox), the focus applies directly to the element. This behavior lets you interact with it without entering the cell first.
The following example demonstrates how to decorate a button inside a template by using kendoTreeListFocusable. The button will be excluded from the page Tab sequence, but can still be focused by using the Arrow keys inside the TreeList.
Controlling the Focus
To control the focus in the TreeList, use any of the following methods:
You can query the cell and row which are currently focused by using the activeCell and activeRow properties. When the TreeList has no focused elements, these properties are undefined.
The following example demonstrates how to use the focus methods to implement the Tab key navigation with in-cell editing.