aka "The Humane League" case study
Enter - action (open link, press button)
Space - toggle action (select checkbox, open/close element)
Arrows - change value in number inputs, move cursor in text
Esc - close modals, expanded comboboxes, cancel prompts
A menu with one togglable submenu
(It needs to be usable using keyboard)
outline focused elements
don't rely on browser/device specific events (like hover, mouseover etc)
if you allow action on hover, need to have a fallback for keyboard
don't rely on keyboard key codes, use HTML interactive elements instead (buttons, links have full support out of the box)
For example, listening to a keypress event and looking for a key code 13 (Enter key) will only catch a real keyboard's Enter key. But it won't catch a screen reader's Enter key, as pressing Enter with a screen reader running will typically fire a click event instead.
JAWS with IE: 24.7%
NVDA with FF: 23.6%
JAWS with FF: 15.1%
VoiceOver/macOS with Safari: 10.0%
Preferences -> Accessibility -> VoiceOver -> "Enable VoiceOver"
Control + Option + Shift + Arrow Down
To enter the website area:
Control + Option + Arrows
To navigate:
ARIA indirectly affects what is reported to a screen reader or other assistive technology.
<h1 role=button>text</h1><button role=heading aria-level=1>text</button><img role=presentation>...</h1>Announced as a button
Announced as a <h1> header
Announced without role (like <div>)
defines additional information about the element, which cannot be derived from native HTML semantics
<label for="telefon">
Numer telefonu
</label>
<input
type="text"
name="telefon"
id="telefon"
aria-required="true"
aria-describedby="tel_info"
>
<p id="tel_info">
Numer telefonu nie może zawierać spacji i myślników
</p>
<button aria-label="Close" onclick="close">
<img src='/close.png'>
</button>Describe menu with aria attributes and make it usable with screen reader
<p role=alert>alert</p>Add new message with role alert attribute after click on button and check it in your screen reader
<div aria-live="off">alert</div><div aria-live="polite">alert</div><div aria-live="assertive">alert</div>Create counter with aria-live