You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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-xpan-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