Skip to content

Commit d1804c9

Browse files
committed
disabling pinch zoom on iOS Safari
1 parent 7425c65 commit d1804c9

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

  • content/blog/disable-pinch-zoom-on-ios-safari
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: 'Disable Pinch Zoom on iOS Safari'
3+
date: 2026-01-22
4+
---
5+
6+
How to do it in modern iOS Safari in 2026?
7+
8+
By default Safari on iOS allows users to pinch zoom on web pages. While this is generally a useful feature but for often for mobile web-apps with responsive design you may want to disable it to avoid layout issues or just to improve user experience.
9+
10+
It's been a while since the last time and my usual go-to viewport meta tag method didn't work so I had to do some research.
11+
12+
If you're like me and think just slap `maximum-scale=1` and `user-scalable=no` directives on the page, here's an update for you: modern Safari on iOS no longer respects these directives and allows to pinch zoom as usual.
13+
14+
Modern and robust way to achieve this is by applying `touch-action` CSS property. To disable pinch zoom on iOS Safari I used the following CSS:
15+
16+
```css
17+
* {
18+
touch-action: pan-x pan-y;
19+
}
20+
```
21+
22+
This will block pinch zooming, double-tap zooming gestures and only vertical and horizontal panning will be allowed.

0 commit comments

Comments
 (0)