Keyboard Navigation

By default, the keyboard navigation of the Kendo UI TreeList for Angular is disabled. To enable keyboard navigation, set the navigable attribute to true.

The TreeList supports the following keyboard shortcuts:

SHORTCUTDESCRIPTION
Right ArrowMoves 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 ArrowMoves 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 ArrowMoves the focus one cell down. If the focus is on the bottom-most cell in the column, the focus does not move.
Up ArrowMoves the focus one cell up. If the focus is on the top-most cell in the column, the focus does not move.
Page DownScrolls to the next page of data. If paging is configured, loads the next page of data, if any.
Page UpScrolls to the previous page of data. If paging is configured, loads the previous page of data, if any.
HomeMoves the focus to the first focusable cell in the row.
EndMoves the focus to the last focusable cell in the row.
Ctrl & HomeMoves the focus to the first cell in the first row.
Ctrl & EndMoves the focus to the last cell in the last row.
Alt & Right ArrowExpands the current row, if applicable.
Alt & Left ArrowCollapses the current row, if applicable.
EnterExpands or collapses the current row, if pressed on an expandable, non-editable column; triggers the cell click action.

When Selection is enabled, the TreeList supports the following shortcuts:

SHORTCUTDESCRIPTION
SpaceSelects the current row or cell.
Ctrl & SpaceToggles the selection of the current row or cell.
Shift & SpaceSelects a range of rows or cells.
Ctrl & ASelects all rows or cells.

When a TreeList cell contains focusable components, the TreeList supports the following shortcuts:

SHORTCUTDESCRIPTION
EnterDisables the keyboard navigation of the TreeList and places the focus on the first widget.
EscapeRestores the keyboard navigation of the TreeList. If the content was in the process of editing, the unsaved edits are removed.
TabMoves the focus to the next focusable component in the current row.
Shift & TabMoves the focus to the previous focusable component in the current row.
Alphanumeric keysIf the cell contains editable content, places the focus in an input fieldfor example, a textbox.
Example
View Source
Edit In Stackblitz  
Change Theme:

Basic Concepts

According to the accessibility guidelines, only one of the focusable elements which are contained by the TreeList has to be included in the Tab sequence of the page.

To control which elements will be accessible through the Tab key, the TreeList implements a roving tabindex. All other focusable elements receive a tabindex of "-1" and get excluded from the Tab sequence.

To implement this requirement, all elements which can receive focus either through the Tab sequence or through direct interaction must be decorated with the kendoTreeListFocusable directive. It registers the focusable elements with the TreeList and provides an interface for controlling their focused state and tabindex. The directive can be applied to both regular input elements, such as inputs and buttons, and composite components, such as drop-down lists. Based on the user actions, the TreeList will include the focused (selected) element in the Tab sequence. Typically, this element is one single cell at a time but when the TreeList is in editing mode, it can also be an entire row.

The user can move the focus from cell to cell by using the available shortcut keys. If a cell contains a single focusable element, such as a button or a checkbox, the focus will be applied directly to the element. This behavior allows the user to interact with it without having to enter 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.

In this article

Not finding the help you need?