Skip to content
easeweb
Search topics

Pinch, drag and tilt gestures with no button

A product's 360-degree view turns only by dragging, zooms only by pinching, and turns whenever the phone tilts, with no button for any of it and no way to stop the tilt.

WCAG 2.2
SC 2.5.1A· new in 2.1SC 2.5.4A· new in 2.1SC 2.5.7AA· new in 2.2
Required by
EN 301 549 (EU)
Broken frame.addEventListener('touchmove', pinchToZoom)
The accessibility problem illustrated: Motor:How do I zoom in with one finger?
01

The problem

People who use one finger, a mouse, a head pointer, a switch, voice control or a screen reader can't turn or zoom the product, and people whose hands or phones move can't stop it turning.

02

Try it

Turn the mug round and read the small print on its back, using single clicks or taps only.

The slider stands in for tilting a phone. Move it on each side: does the mug hold still until you ask it to turn? Drag and pinch work too, but try without them.

0°

Broken Can you fix this?

Enamel mug
Drag to turn. Pinch to zoom.

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Give every gesture a button that does the same, and make turning by tilt something people switch on.

  1. 1Every turn, zoom and move that a gesture makes can also be made with single clicks or taps on a visible control.
  2. 2Tilting or shaking the phone does nothing until a control on the page turns it on, and the same control turns it off.
  3. 3The gestures stay as shortcuts, and a finger on the view still scrolls the page.
Before A view that only gestures work
<figure class="spin-view">  <div class="spin-frame">    <img src="mug-00.jpg" alt="Enamel mug">  </div>  <figcaption>Drag to turn. Pinch to zoom.</figcaption></figure>
After Buttons beside the view, and tilting as a switch
<figure class="spin-view">  <div class="spin-frame" tabindex="0" role="region" aria-label="Zoomed photo">    <img src="mug-00.jpg" alt="Enamel mug">  </div>  <figcaption>Drag to turn. Pinch to zoom.</figcaption>  <div class="spin-controls">    <button type="button" data-turn="-1">Turn left</button>    <button type="button" data-turn="1">Turn right</button>    <button type="button" data-zoom="-1">Zoom out</button>    <button type="button" data-zoom="1">Zoom in</button>    <button type="button" class="tilt-switch" aria-pressed="false" hidden>Turn by tilting the phone</button>  </div></figure>

Fixing this with an AI coding assistant? Get this guide as Markdown

04

Verify the fix

5 checks.

Test with: Mouse, Touch, Device motion, Keyboard, Speech input, Screen reader

0 of 5 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the viewer or its library changes.

Limits

This is a starting pattern, not a guarantee for every viewer. Both 2.5.1 and 2.5.4 make an exception where the gesture or the motion is essential, such as a signature drawn with a finger, a step counter or a game played by tilting; check that claim honestly before relying on it. Other gestures have guides of their own: swiping between slides in carousels that keyboard and screen reader users can't use, dragging a thumb in range sliders that only move by dragging, dragging cards in drag-and-drop boards that only a mouse can use, and swiping or long-pressing a row in right-click, long-press and swipe actions with no button. Test the complete journey on the phones and assistive technology your customers use.

This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.

Keep this fixed as your code changes.

Turn guides like this into rules your coding agents and CI follow, then have the result retested with a keyboard and screen readers.

How retests work