1. Executive Summary & WCAG 2.2 Focus Criteria
Keyboard accessibility is the cornerstone of web inclusivity. Millions of citizens relying on screen readers, switch access devices, eye-tracking hardware, or motor-impaired keyboard navigation cannot use a pointing mouse. Under W3C WCAG 2.2 Level AA and the statutory GIGW 3.0 standards, every interactive element must be keyboard operable without keyboard traps, and its active focus indicator must be unmistakably visible.
2. CSS Implementation: The :focus-visible Standard
A common anti-pattern in modern web development is removing the default browser focus outline using outline: none or outline: 0 without providing a styled replacement. This instantly breaks accessibility.
The modern solution is using :focus-visible, which only shows outlines when the user interacts via a keyboard, preserving a clean aesthetic for mouse clickers while ensuring 100% keyboard accessibility:
3. Eliminating Keyboard Traps in Dialogs & Drawers
Under Success Criterion 2.1.2 (No Keyboard Trap), when a modal dialog or navigation menu opens:
- Focus must be immediately moved to the first interactive element inside the modal.
- Tab and Shift+Tab must be trapped inside the modal while open.
- Pressing the
Escapekey must dismiss the modal. - Upon closing, focus must be returned to the trigger button that launched the modal.
4. Keyboard Accessibility Audit Checklist
| Audit Checkpoint | WCAG Success Criterion | Verification Method |
|---|---|---|
| Full Operability | 2.1.1 Keyboard (Level A) | Disconnect mouse. Can all forms, menus, and controls be reached and activated via Tab / Enter / Space? |
| No Keyboard Traps | 2.1.2 No Keyboard Trap (Level A) | Navigate into all modals, widgets, and dropdowns. Can you exit using Tab or Esc without reloading? |
| Focus Visible | 2.4.7 Focus Visible (Level AA) | Does a clear outline (minimum 2px with 3:1 contrast) appear around every focused element? |
| Focus Not Obscured | 2.4.11 Focus Not Obscured (WCAG 2.2 AA) | Does sticky header/footer avoid completely covering focused input fields during keyboard navigation? |
WebOTG Standards Directorate
WebOTG provides benchmark reference documentation, automated matrix evaluators, and security test harnesses for government digital platforms, WQMS architectures, and STQC compliance frameworks.