Keyboard and focus
This page is for developers and designers who build templates and scripts, and for administrators and trainers who support staff working with the keyboard. Everything a mouse can do must be possible with the keyboard, and people must always see where the focus is. WCAG 2.2 covers this under 2.1.1, 2.1.2, 2.4.3, 2.4.7 and 2.4.11 (https://www.w3.org/TR/WCAG22/).
Contents
In the administration
admin4 is built and tested for keyboard use (The admin4 design: Keyboard,
tests/tests/design/AdminKeyboardTest.php, AdminTreeViewTest.php, AdminContextMenuTest.php):
- "Skip to main content" is the first Tab stop.
- Node tabs follow the WAI-ARIA tabs pattern (arrows, Home, End).
- The content tree follows the tree view pattern (arrows, letters, Shift+F10 for the item's menu).
- Context menus and header menus open and move with the keyboard; Escape closes and returns the focus.
- Reordering sub items by drag and drop has a keyboard mode on the grip.
- Calendar pickers open from a named button and return the focus.
- One shared focus ring, 3 px, checked for 3:1 contrast.
Keys to teach your staff
The user page Keyboard shortcuts lists them; the most useful:
| Key | Does |
|---|---|
| Tab (first press) | shows Skip to main content |
/ | jumps to the search field |
| Esc | closes the open menu or pop-up |
| arrows in the tree | move, open and close items |
| Shift+F10 | opens the menu of a tree item or a sub items row |
Rules for your public design
- Native elements first: links for navigation, buttons for actions; no clickable
div. - Order: the Tab order follows the visual order; do not use positive
tabindex. - Visible focus on every link and control; never
outline: nonewithout a replacement. - Not obscured: sticky headers, cookie notices and chat widgets must not cover the focused element (2.4.11).
- No traps: embedded maps, video players and CAPTCHAs must let the focus leave with Tab.
- Menus: drop-down menus open with Enter or Space, close with Escape, and return the focus.
- Dialogs: move focus into the dialog, keep it there while open, return it on close.
Testing
Put the mouse away and use the page with Tab, Shift+Tab, Enter, Space, Escape and the arrows, following the keyboard pass in Testing your site's accessibility. Do it for every page template, every form and every interactive block.
Related pages
- Keyboard shortcuts
- The admin4 design
- Menus and navigation
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.