touch-action

Term side of the Card.
Topic: Client Interface
Unit title: touch-action
Categories: Property
Explanation side of the Card

Explanation: The property that controls how touch interactions are handled on touch-enabled devices. It can specify whether touch gestures like scrolling, zooming or panning are enabled or disabled, optimizing user experience for touch interfaces.

Browser compatibility:
  • The chrome browser supports this feature starting from version 36.
  • The edge browser supports this feature starting from version 12.
  • The firefox browser supports this feature starting from version 52.
  • The safari browser supports this feature starting from version 13.
Availability: 

Example

Wrongcss
body {
  touch-action: none;
}
Rightcss
.signature-pad {
  touch-action: none;
}
.carousel {
  touch-action: pan-y;
}

Only the drawing area blocks browser gestures, and the carousel still lets the page scroll vertically.

Common mistakes

  • Pointer events get cancelled mid-drag because the browser starts scrolling.
  • Setting touch-action: none on the body and breaking scroll and zoom.

Key points

  • Elements with custom pointer drag or drawing set touch-action: none only on that element.
  • Horizontal sliders use touch-action: pan-y so vertical page scrolling still works.
  • Pinch zoom is not disabled for the whole page.

Interview questions

What does touch-action: manipulation do?

It allows panning and pinch zoom but disables double-tap zoom, so taps respond without waiting for a second tap.

Why do my pointermove events stop on mobile?

The browser takes over the gesture to scroll and fires pointercancel; set a touch-action that blocks that gesture.

Analytics cookiesWe'd like to use analytics cookies to see which pages are useful. They're set only if you accept. Privacy Policy