WCAG 2.2 success criterion, Level A
WCAG 2.5.2 Pointer Cancellation
When something can be done with a single tap or click, it should happen when the person lets go, not when they first press down, so that someone who presses the wrong thing can slide off it and nothing happens.
- Number
- 2.5.2
- Level
- A
- Added in
- WCAG 2.2
- Guideline
- 2.5 Input Modalities
- Principle
- Operable
What it asks
Most people never notice when a button fires. Press, release, done. For someone with a tremor, or who is using a head pointer or a stylus with limited control, pressing in the wrong place is routine. If the action fires the moment the pointer goes down, every slip is a mistake made. If it fires on release, the person can move the pointer off the control before letting go, and nothing happens.
The rule applies to functions operated with a single pointer, and gives four ways to meet it. No down-event: the press itself does nothing, and the action happens on release. Abort or undo: the action completes on release, and there is a way to abort it before it completes or undo it afterwards. Up reversal: releasing reverses whatever the press did, as with a button that shows a preview while held. Essential: completing on the press is essential to the function, as with a piano key or a game control.
Native HTML buttons and links already behave this way: the browser fires a click on release, and moving the pointer off the control before releasing cancels it. The problems come from custom code that listens for mousedown, pointerdown or touchstart and acts on it directly.
It does not cover keyboard events, and it does not cover gestures that depend on a path, which belong to 2.5.1 Pointer Gestures.
Its official name is success criterion 2.5.2 Pointer Cancellation, at Level A. It was added in WCAG 2.2, under guideline 2.5 Input Modalities and the principle Operable. The W3C’s normative text says, in part:
“The down-event of the pointer is not used to execute any part of the function”
From WCAG 2.2, W3C. Full explanation: Understanding 2.5.2 Pointer Cancellation.
Who it helps
People with tremors, spasms or limited fine motor control, who press the wrong target often and need a chance to recover. People using head pointers, eye tracking or a mouth stick, where positioning is slow and a wrong press is easy. People with cognitive disabilities, who may press before they have finished deciding.
It also helps anyone using a phone on a moving train.
What passes and what fails
These pass
- A standard HTML button, which fires on release and cancels if the pointer moves off it first.
- A "Delete" action that completes on release and shows an "Undo" option for a few seconds afterwards.
- A drag handle that picks up an item on press and drops it back where it was if the person releases outside any valid target.
- A "Hold to preview" button that shows a preview while pressed and hides it on release.
- A drawing tool that starts a stroke on press, because starting the stroke on the press is essential to drawing.
These fail
- A delete button wired to
mousedown, which removes the item the instant the pointer goes down. - A drag handle that commits a move on press, with no way to cancel by releasing elsewhere.
- A canvas tool that performs an action on
touchstartwith no undo. - A menu item that navigates on
pointerdown, so a slip while scrolling opens a page. - A toggle that flips state on press and does not flip back on release when the pointer has left it.
How to test it by hand
- Find every control that does something when pressed: buttons, links, menu items, toggles, drag handles, canvas tools and custom widgets.
- For each one, press down on it, move the pointer off it without releasing, then release. Nothing should happen.
- Where something does happen on press, check whether releasing reverses it, or whether there is a way to abort it before it completes or undo it afterwards.
- In the browser’s developer tools, look for
mousedown,pointerdownandtouchstartlisteners on controls, which are the usual cause. - For any control that acts on press with none of the three escapes, ask whether acting on the press is essential to what it does.
What automated testing can decide
What a machine can decide
Automated testing can find the controls that act on the press rather than on release, and show which of them did something before the pointer was let go. That is the list a reviewer needs.
What it cannot
A down-event handler is often harmless. It may start a visual effect, begin a drag that can still be cancelled, or do nothing more than note where the pointer went down. Whether an undo exists, whether release reverses the effect, and whether acting on the press is essential are questions about what the function is for, and a tool that sees a change in the page cannot tell a committed action from a reversible one.
How Dreven handles it
Dreven finds the controls on your pages that act when the pointer goes down rather than when it is released, and shows you each one with the page and a picture of what happened.
A reviewer decides each result, because the action may be reversible, undoable or essential, and the report says how each one was decided.
No automated check makes a site conform. In Dreven, a person reviews the results and signs the report.
Related criteria
- 2.5.1 Pointer Gestures (Level A). Complex gestures need a simple single-pointer alternative.
- 2.5.7 Dragging Movements (Level AA). Dragging needs a single-pointer alternative, and the alternative should also complete on release.
- 3.3.4 Error Prevention (Legal, Financial, Data) (Level AA). Actions with legal or financial consequences need a chance to check, confirm or reverse.
- 2.5.8 Target Size (Minimum) (Level AA). A larger target is harder to miss in the first place.
Questions people ask
Do normal HTML buttons meet WCAG 2.5.2?
Yes. The browser fires a click on release, and if the pointer moves off the button before release, no click happens. Problems arise in custom code that acts on mousedown, pointerdown or touchstart.
Is it ever acceptable to act on the down-event?
Yes, in three cases: if releasing reverses the effect, if there is a way to abort before completion or undo afterwards, or if acting on the press is essential to the function, such as a piano key in a music app.
Does 2.5.2 apply to keyboard actions?
No. It covers functions operated with a single pointer: a mouse, a finger, a stylus or similar. Keyboard behaviour is covered by the keyboard criteria.
Does an Undo option satisfy 2.5.2?
It can. If the function completes on release and the person can undo it afterwards, or abort it before it completes, the abort or undo option is met. The undo has to be real and reachable, not a notification that disappears before it can be used.