AXS-39Required
Make every gesture work with one tap
Make every action that needs a multi-finger or path gesture also work with single taps. Act on release, not on press. These are WCAG criteria 2.5.1 and 2.5.2 (A).
How to do it
Pair pinch zoom and swipe with buttons, such as plus and minus or next and previous. Run actions on click or pointerup, never pointerdown, so people can slide off to cancel. Any action triggered by shaking or tilting the device needs a button too, as 2.5.4 (A) asks. Size those buttons as Make tap targets big enough says.
Examples
HTML example
<div class="map" aria-label="Map of the shop">…</div>
<button type="button" aria-label="Zoom in">+</button>
<button type="button" aria-label="Zoom out">−</button>
How to check
A search of the scripts finds no pointerdown, mousedown or touchstart handler that completes an action. Each gesture feature has a test that completes it with clicks.
Sources
- WCAG 2.2 – 2.5.1 Pointer Gestures
- WCAG 2.2 – 2.5.2 Pointer Cancellation
- WCAG 2.2 – 2.5.4 Motion Actuation
Related rules
- AXS-38 Offer a way that needs no dragging in Accessibility
- AXS-37 Make tap targets big enough in Accessibility
- AXS-47 Offer an action for every custom gesture in Accessibility
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/accessibility/touch-motion-and-sound/pointer-gestures">Agent Wranglers accessibility playbook</a>. In code you write, add a comment next to it with the same link.