Keyboard Navigation Broken on Website
Lighthouse (Accessibility audit — "Interactive elements must be focusable"), axe DevTools (rule: scrollable-region-focusable, tabindex), WAVE (Error: Missing form label, keyboard trap), Pa11y (WCAG2AA.Principle2.Guideline2_1.2_1_1)
Why it matters
Approximately 7 million Americans have a motor disability affecting hand and arm movement, making keyboard navigation their primary — or only — way to use the web. This includes people with ALS, multiple sclerosis, Parkinson's disease, and spinal cord injuries. Many power wheelchair users control their computers via switch access or sip-and-puff devices that emulate keyboard input. When your site breaks keyboard navigation, these users are completely locked out — they cannot browse products, fill forms, complete purchases, or access information. Under WCAG 2.1.1, keyboard accessibility is a Level A requirement, meaning it is considered a baseline that all websites must meet. Courts have consistently held ADA violations for keyboard inaccessibility. In 2022, a federal court found Domino's liable in part because users with disabilities could not operate the site without a mouse.
Symptoms — what you'll see
If your site has this problem, you may observe any of the following:
- Tab key does not move focus to interactive elements
- Focus jumps unpredictably or skips important controls
- Dropdown menus or modals open but can't be operated or closed with keyboard
- Custom components (sliders, date pickers, carousels) are completely inaccessible via keyboard
- JavaScript event handlers respond only to mouse click, not Enter or Space keypress
- Focus disappears entirely after clicking certain elements
- Navigation menus require mouse hover to reveal sub-items
Common causes
- Using <div> or <span> elements as buttons or links instead of native HTML elements
- Setting tabindex="-1" on elements that should be reachable by keyboard
- JavaScript event listeners that only fire on mouse events (click, mousedown, mouseover)
- CSS that hides the :focus outline without providing an alternative visible indicator
- Third-party widgets (chat widgets, date pickers, carousels) that were not built with accessibility in mind
- Single Page Application (SPA) routing that moves content but does not manage focus
- Modal dialogs that do not trap or redirect focus appropriately
- Dropdown navigation menus that only respond to CSS :hover pseudo-class
How to fix it
- 1Audit your site by unplugging your mouse and tabbing through every page — note every element that should be interactive but is not reachable.
- 2Replace non-semantic elements (div, span) used as buttons with <button> or <a> elements, which receive keyboard focus natively.
- 3Ensure all custom interactive components implement the ARIA keyboard interaction patterns from the ARIA Authoring Practices Guide (APG).
- 4Remove or correct any tabindex="-1" set on elements that should be in the focus order, and remove tabindex values greater than 0.
- 5Add visible :focus-visible CSS styles so keyboard users can see where focus is at all times.
- 6Test modal dialogs: focus must move into the dialog on open, cycle within it, and return to the trigger on close.
- 7Verify that JavaScript event listeners that use mousedown or click also handle keydown for Enter and Space keys.
Code example
<!-- BROKEN: div-button with only mouse handler -->
<div class="btn" onclick="submitForm()">Submit</div>
<!-- BROKEN: custom dropdown with no keyboard support -->
<div class="dropdown" onmouseover="openMenu()">
Products
<div class="dropdown-menu" style="display:none">...</div>
</div><!-- FIXED: semantic button, keyboard accessible by default -->
<button type="button" class="btn" onclick="submitForm()">Submit</button>
<!-- FIXED: keyboard-operable dropdown with ARIA -->
<button
aria-haspopup="true"
aria-expanded="false"
aria-controls="products-menu"
id="products-btn"
>
Products
</button>
<ul id="products-menu" role="menu" aria-labelledby="products-btn" hidden>
<li role="none"><a role="menuitem" href="/products/a">Product A</a></li>
</ul>How to test your fix
After applying the fix, verify it works using these testing steps:
- Disconnect your mouse entirely and navigate the full page using Tab, Shift+Tab, Enter, Space, and arrow keys.
- Verify that every interactive element (links, buttons, form fields, dropdowns, tabs, accordions) can be reached and activated.
- Check that focus never disappears — you should always see a visible focus indicator.
- Open any modal dialogs: confirm focus moves inside, cycles within, and returns to the trigger on close.
- Run Lighthouse in Chrome DevTools > Accessibility and check for keyboard-related violations.
- Install the axe DevTools browser extension and scan each page — filter violations by "keyboard" category.
- Use NVDA (Windows) or VoiceOver (Mac) screen reader together with keyboard-only navigation to test the real-world experience.
Frequently asked questions
Why does keyboard navigation matter if most users use a mouse?+
About 26% of US adults have some form of disability, and motor impairments affect millions who rely exclusively on keyboard or keyboard-emulating input devices (switches, eye-tracking, sip-and-puff). Beyond disability, keyboard navigation is required for ADA/WCAG compliance, and violations expose businesses to lawsuits with settlements averaging $25,000–$75,000.
Can I just set tabindex="0" on every div to fix keyboard navigation?+
No. Adding tabindex="0" makes an element focusable but does not make it operable. Screen reader users expect native semantics — a <div tabindex="0"> does not fire on Enter/Space by default and does not announce its role. Use semantic HTML elements (<button>, <a>, <select>) which handle all keyboard interactions natively.
How do I test keyboard navigation without a screen reader?+
Simply unplug your mouse (or disable it in System Preferences) and try to complete common user tasks — browsing products, filling a form, completing checkout — using only Tab, Shift+Tab, Enter, Space, and arrow keys. Any element you cannot reach or operate is a keyboard accessibility failure.
Does WCAG 2.1.1 apply to all keyboard types including mobile?+
Yes. WCAG 2.1.1 requires that all functionality be operable through a keyboard interface. This includes Bluetooth keyboards connected to phones/tablets, iOS switch access, Android TalkBack with keyboard, and any assistive technology that emulates keyboard input.
What is the fastest way to find keyboard traps?+
Tab into each interactive component on the page. If you cannot get out using Tab, Shift+Tab, or Escape, that is a keyboard trap (WCAG 2.1.2 violation). Automated tools like axe DevTools flag many keyboard traps automatically, but manual testing remains essential for complex widgets.