Redundant Event Handlers Check
Description
The “Redundant Event Handlers Check” evaluates whether all interactive elements on the page with mouse event handlers also include corresponding keyboard event handlers or are implemented using semantic HTML elements that already provide built-in keyboard support (like <button>
or <a href>
).
Example outcome
I identified all instances where redundant event handlers are used.
Impact
- Visual Impairments: Many rely on screen readers, which are navigated via keyboard — mouse-only interaction creates a barrier.
- Motor Impairments: Individuals who use keyboards, switch devices, or eye-tracking tools instead of a mouse won’t be able to activate or interact with components missing keyboard support.
Fixes
To address missing redundant event handlers:
- Locate the element that can be triggered by a mouse event but can’t be triggered by a keyboard event.
- Add an attribute (e.g.,
onkeydown
) to allow the triggering with a keyboard event. - If applicable, use an HTML element instead containing built-in keyboard accessibility (e.g.,
<button>
).