-
Notifications
You must be signed in to change notification settings - Fork 96
Closed
Description
From a chat with @jscholes off-site:
This is a difficult sort of mechanism to make accessible for some users, because reliance on keyboard input (or tools that emulate it like speech recognition software) will conflict with the tool's requirement to take all keyboard input and swallow it. Indeed, as a screen reader user, it's difficult to get rid of it once loaded! :)
Here's what I'd suggest:
- Give the hotkey input area (
id="hotkey-code"
) atabindex
of"0",
so users can explicitly place focus on it. - Give the same area the following attributes:
role="application"
,aria-roledescription="Input Capture"
,aria-label="Hotkey"
,aria-live="assertive"
, andaria-atomic="true"
. - Bind your
keydown
handler to that inputdiv#hotkey-code
, instead of the entire document. - Make it visually obvious in some way that mouse users should click (or keyboard users should focus) the input area in order to trigger the behaviour, as it will no longer apply to the full page. This should include a focus outline.
- Disallow Tab and Shift+Tab from being used as tool input, so users can get out of the input capture area. This is both an explicit accessibility recommendation for this page, as well as an inclusive design tip: users shouldn't be rebinding Tab and Shift+Tab so the tool should discourage it.
- Remove tabindex="0" and role="button" from the clipboard-copy component. The inner button already has all of the semantics that are needed.
- Move the copy button after the input area, both visually and in the mark-up, so users don't have to navigate backwards to reach it.
Metadata
Metadata
Assignees
Labels
No labels