Keyboard Navigation
Esc goes to the innermost thing first. An open dialog or menu closes before anything else. Text in a search field is cleared before the page reacts.
| Where | Key | What happens |
|---|---|---|
| a dialog, an alert dialog, a dropdown menu | Esc | it closes. Nothing else happens |
| a list’s search field, with text | Esc | the text is cleared. The search row stays open |
| a pantry list in Select mode | Esc | Select mode ends, when no dialog, menu or search text used the key. The focus goes to the Select toggle |
| a pantry list in Select mode | Cancel | the same as Esc |
In code, a handler that uses Esc calls event.preventDefault(). A page-level Esc handler checks event.defaultPrevented first, and ignores an Escape with event.isComposing (it ends an input method composition). See List Toolbars.