2.5.2 Pointer Cancellation

WCAG 2.2 · 2.5.2 A Operable

What it requires

For any function that can be operated with a single pointer (mouse, touch, stylus), at least one of the following must be true:

  • No down-event activation — the function does not complete on the down-event (mouse-down or touch-start).
  • Abort or undo — completion happens on the up-event, and the user can move the pointer away before releasing to abort it, or can undo the action afterwards.
  • Up reverses down — the up-event reverses any outcome of the down-event.
  • Essential — completing on the down-event is essential (for example, playing a piano key in an instrument app, or a fast-paced game).

In short: a press should not be irreversible the instant a finger or button goes down. Users must be able to change their mind before the pointer is released.

  • People with motor impairments or tremors who frequently touch or click the wrong target and need a way to slide off and cancel.
  • People who target imprecisely on touchscreens, including those using a head pointer, mouth stick, or switch.
  • People with cognitive or visual disabilities who may press first and read the label only afterwards.
  • Anyone who accidentally taps the wrong control — cancellation benefits all users.

How to detect it

Checks for Pointer Cancellation
Check How What fails
Press & slide off Press a control, slide the pointer away, then release. Action fired anyway, or fired the moment you pressed down.
Event bindings Inspect code for mousedown/touchstart/pointerdown triggering actions. The action runs on down rather than on click / up.
Undo path If down-event is essential or used, confirm an undo exists. No way to reverse an accidental activation.
Automated tools Run axe or similar. Cannot reliably detect this — it requires manual interaction testing.

How to fix it

  1. Activate functions on the up-event (click / pointerup), not on the down-event.
  2. Prefer native <button> and <a> elements, whose default activation already fires on release and respects slide-off cancellation.
  3. If you must use a down-event (e.g. drag start), provide an undo or make the up-event reverse the result.
  4. Reserve down-event activation for cases where it is genuinely essential.

Use the click event so slide-off naturally cancels:

<button type="button" id="delete">Delete</button>

<script>
  // Fires on the up-event; sliding off before release cancels it.
  document.getElementById('delete')
    .addEventListener('click', remove);
</script>

Copy-paste tests

Automated coverage

There is no fully automated axe-core rule that proves pointer cancellation, so this criterion needs manual review. Use the console check and steps below to find candidates, then verify them by hand.

Run this in the browser console

pointer-cancellation-audit.js
// Read-only: lists elements wired to mousedown/pointerdown/touchstart,
// which often trigger actions on the down-event (a 2.5.2 risk).
const hits = [...document.querySelectorAll('*')].filter(el =>
  ['onmousedown','onpointerdown','ontouchstart'].some(a => el.hasAttribute(a))
);
console.table(hits.map(el => ({
  tag: el.tagName, id: el.id, cls: el.className,
  text: (el.textContent || '').trim().slice(0, 40)
})));
hits.forEach(el => { el.style.outline = '2px solid magenta'; });
console.log('Down-event handlers found:', hits.length);

What to check manually: a script cannot confirm intent. Activate each flagged control and verify the action fires on release (up-event), not on press, and that moving the pointer off the control before releasing aborts it. Also test custom drag/canvas widgets that bind listeners in JavaScript.