Priya Shah
Photos from the weekend
Here are the pictures from the lake. The one with the red boat is my favorite.
Operable · 2.5 Input Modalities
For single-pointer functions, at least one must hold: the down-event does not trigger the action; the action completes on the up-event and can be aborted or undone; the up-event reverses the down-event; or completing on the down-event is essential, as when emulating a keyboard key press.
Live demo
The same task, done two ways: switch between the version that passes and the one that fails, or put them side by side. Everything in the box is live, so try it with a keyboard, a pointer or a screen reader.
Press down on Delete message and keep holding. Slide the pointer off the button, then let go. Try it in both versions.
Priya Shah
Photos from the weekend
Here are the pictures from the lake. The one with the red boat is my favorite.
Priya Shah
Photos from the weekend
Here are the pictures from the lake. The one with the red boat is my favorite.
The tools follow the version you last used.
What happened
Why it passes
Nothing happens until you let go over the button. If you pressed it by mistake, you slide away before releasing and the message is kept.
Why it fails
The message is deleted the moment you press down. Sliding away does not help and there is no undo, so a slip of the finger loses the email.
Examples
Five examples, each one running: the usual ways this criterion fails, and code that passes. Listen to them, measure them, or copy the code.
Fails
Live preview
// The message is gone the moment a finger or mouse button goes down.const del = document.getElementById('delete-message');del.addEventListener('pointerdown', () => { deleteMessage(messageId);});
The action completes on the down-event, so someone who presses the wrong button cannot slide off to cancel it, and there is no undo.
Passes
Live preview
// The browser fires click on the button only when both the press// and the release happen on it.const del = document.getElementById('delete-message');del.addEventListener('click', () => { deleteMessage(messageId);});
The action waits for the up-event. Moving the pointer off the button before letting go abandons it, and click also works from the keyboard.
Fails
Live preview
// Opens the product as soon as a finger touches the card, even to scroll.document.querySelectorAll('.product-card a').forEach((link) => { link.addEventListener('touchstart', () => { window.location.href = link.href; });});
A person who touches a card only to start scrolling is taken to the product at once. The down-event completes the action, so it cannot be aborted.
Passes
Live preview
<ul class="products"> <li class="product-card"> <a href="/shop/harbor-rain-jacket">Harbor rain jacket</a> </li></ul>
Without a down-event handler, the browser follows the link only when the tap or click is released on it, and cancels it when the finger moves to scroll.
Passes
Live preview
// Each key of an on-screen keyboard types on press, like a real key.document.querySelectorAll('.keyboard-key').forEach((key) => { key.addEventListener('pointerdown', () => { typeCharacter(key.dataset.char); });});
The criterion treats functions that emulate a keyboard or numeric keypad key press as essential, so acting on the down-event is allowed here.
Why it matters
People with motor impairments, tremor or low vision often press the wrong target by accident. Letting them slide off before releasing, or undo the action, prevents mistakes they did not intend.
W3C: Understanding 2.5.2Level A
Level A is the minimum: failing it can shut some people out completely.
Where it is required
Required where the law names WCAG 2.1 or later at this level: the United States, Canada, the European Union, the United Kingdom, France, Germany, Italy, Spain, the Netherlands, Ireland, Norway, Switzerland, India, Australia and New Zealand.
How to test
A few concrete steps. Automated tools find some failures; most need a person.
Common failures