OAA WIDGET_12: Check that elements with mouse event handlers also have key event handlers

Details

  • Check that elements with mouse event handlers also have key event handlers.

Rulesets

WCAG 2.0 Requirement 2.1.1 Keyboard
Status: Accepted
Severity: Violation
Priority: Priority 1
IITAA 1.0 13.2 Ensure that significant interactions can be performed with both keyboard and mouse.
Type:
Severity: Violation
Priority: Priority 1
Status: Accepted

Markup References

Validation Code

Message

An element that includes onMouseXXX event handlers and ACTIVE-DESCENDANT attribute defined, must have a onKeyDown or onKeyPress event handlers.

Dependencies

None

Context

*[@aria-activedescendant]

Parameters

None

Code


   function (ruleContext) {
      var events = util.getEvents(ruleContext);
      var passed = (events.toString().indexOf("mouse") == -1 || events.indexOf("keydown") >= 0 || events.indexOf("keypress") >= 0);
      return new ValidationResult(passed, [ruleContext], '', '', []);
   }