accessibility-developer-tools icon indicating copy to clipboard operation
accessibility-developer-tools copied to clipboard

AX_FOCUS_02 should check for keyboard event handler as well as focusability.

Open jdan opened this issue 10 years ago • 1 comments

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.

jdan avatar Jun 11 '15 20:06 jdan

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.

alice avatar Jun 23 '15 10:06 alice