# touch-action

> The `touch-action` CSS property specifies how touch input events should be handled by an element, such as scrolling or zooming.

## How do I stop the page from scrolling while dragging on touch screens?

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.

- Topic: Client Interface
- Type: property
- Browser support: Chrome 36+, Chrome Android 36+, Edge 12+, Firefox 52+, Firefox Android 52+, Safari 13+, Safari iOS 9.3+

## Example

Wrong:

```css
body {
  touch-action: none;
}
```

Right:

```css
.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.

## Related cards

- [pointer-events](https://wonderium.dev/css/pointer-events.md)
- [.addEventListener()](https://wonderium.dev/js/add-event-listener.md)
- [scroll-behavior](https://wonderium.dev/css/scroll-behavior.md)
- [Dragging Movements](https://wonderium.dev/a11y/dragging-movements.md)
- [user-select](https://wonderium.dev/css/user-select.md)

---

- Level: [CSS](https://wonderium.dev/css.md)
- HTML version: https://wonderium.dev/css/touch-action
- Last updated: 2026-11-25
