R

RatedWithAI

WCAG guidance

Scan your site

WCAG 2.1

2.5.2 Pointer Cancellation

Level A success criterion

For functionality that can be operated using a single pointer, at least one of the following is true: the down-event is not used to execute the function, the function completes on the up-event with the ability to abort or undo, the up-event reverses the outcome of the down-event, or completing the function on the down-event is essential.

Why it matters

Users with motor impairments often accidentally touch or click the wrong target. Pointer cancellation gives users the chance to correct mistakes by moving away before releasing.

Common violations

  • Buttons that trigger actions on mousedown/touchstart instead of click
  • Drag operations with no undo mechanism
  • Links that navigate on pointer down rather than pointer up
  • Destructive actions with no confirmation or reversal

Code examples

Bad

<button onmousedown="deleteAccount()">Delete Account</button>

Good

<button onclick="deleteAccount()">Delete Account</button>
<!-- onclick fires on pointer up, allowing user to move away to cancel -->

How to fix

Use click events (which fire on pointer up) instead of mousedown or touchstart for actions. For complex interactions, provide an undo mechanism or confirmation step.

Related criteria

Related resources

Scan your site

Check your WCAG coverage in minutes

Start a free scan