Keyboard Navigation
The keyboard navigation of the Dialog is always available.
When the Dialog is opened, the initial focus is set on the Dialog
element. This approach enables the user to immediately select or navigate between the action buttons by using the Tab
and Shift
+Tab
keys, and to close the Dialog with the Esc
button.
You can set the initial focus to one of the action buttons by using the autoFocus
attribute.
SHORTCUT | DESCRIPTION |
---|---|
Esc | Calls the onClose event handler. |
Shift +Tab | Moves the focus to the previous focusable element. |
Tab | Moves the focus to the next focusable element. |
The following example is based on the official accessibility standard for a modal dialog.