accessibility-developer-tools
accessibility-developer-tools copied to clipboard
AX_FOCUS_02 should check for keyboard event handler as well as focusability.
In AX_FOCUS_02, we see the following:
<!-- Good: span with onclick attribute is in the tab order -->
<span onclick="doSomething();" tabindex="0">Click me!</span>
<!-- Good: span with onclick attribute may be focused programmatically -->
<span onclick="doSomething();" tabindex="-1">Click me too!</span>
Followed by:
Elements which have click handlers but are not focusable can not be used by keyboard-only users.
Would one be able to invoke doSomething() with the keyboard alone? I was under the impression that only inherently focusable elements were keyboard accessible without also adding a keydown|keyup handler.
Thanks for the question. I checked it out and actually it's only interactive content which gets synthetic clicks - so yeah, roughly only the inherently focusable elements.
So this text should be clarified, and the rule should probably also check for a keyboard (keydown/keypress/keyup) event.