Quantcast
Channel: How do you disable viewport zooming on Mobile Safari? - Stack Overflow
Browsing all 21 articles
Browse latest View live

Answer by ganar for How do you disable viewport zooming on Mobile Safari?

2023 Update: on accessibility and the current state of Safari IOSWe had an auto-zoom issue with an input focus in a form, in Safari iOS. Solving the issue turned out to be more complex that we...

View Article



Answer by Hafiz Fahad Munir for How do you disable viewport zooming on Mobile...

I tried all above things but this worked for me on IOS devices:<meta name="viewport" content="width=device-width, initial-scale=1.0, height=device-height, minimum-scale=1.0, user-scalable=0">

View Article

Answer by Emperor Eto for How do you disable viewport zooming on Mobile Safari?

As of today (Oct. 2022) with iOS 14.8, the ONLY way I could completely prevent the double tap zoom was this:document.addEventListener("click", (e) => { e.preventDefault(); })Even this:* {...

View Article

Answer by Pham Duc Toan for How do you disable viewport zooming on Mobile...

Actually Apple disabled user-scalable=no on latest iOS versions.I tried as guideline and this way can work:body { touch-action: pan-x pan-y;}

View Article

Answer by amin for How do you disable viewport zooming on Mobile Safari?

As mentioned this solution basically works as of late 2020:document.addEventListener('gesturestart', (e) => e.preventDefault());But the downside is that while you are scrolling you'd still be able...

View Article


Answer by Feross for How do you disable viewport zooming on Mobile Safari?

Using the CSS touch-action property is the most elegant solution. Tested on iOS 13.5 and iOS 14.To disable pinch zoom gestures and and double-tap to zoom:body { touch-action: pan-x pan-y;}If your app...

View Article

Answer by José Antonio Postigo for How do you disable viewport zooming on...

I got it working in iOS 12 with the following code:if (/iPad|iPhone|iPod/.test(navigator.userAgent)) { window.document.addEventListener('touchmove', e => { if(e.scale !== 1) { e.preventDefault(); }...

View Article

Answer by imelgrat for How do you disable viewport zooming on Mobile Safari?

I managed to stop this behavior by adding the following to the HTML header. This works on mobile devices, as desktop browsers support zooming when using the mouse wheel. It's not a big deal on desktop...

View Article


Answer by Welshboy for How do you disable viewport zooming on Mobile Safari?

I foolishly had a wrapper div which had a width measured in pixels. The other browsers seemed to be intelligent enough to deal with this. Once I had converted the width to a percentage value, it worked...

View Article


Answer by Cihan Zengin for How do you disable viewport zooming on Mobile Safari?

This one should be working on iphone etc.<meta name="viewport" content="width=device-width, initial-scale=1 initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

View Article

Answer by Nikhil Gowda for How do you disable viewport zooming on Mobile Safari?

This works fine in IOS 10.3.2 document.addEventListener('touchmove', function(event) { event = event.originalEvent || event; if (event.scale !== 1) { event.preventDefault(); } }, false);thank you...

View Article

Answer by Arthur Tsidkilov for How do you disable viewport zooming on Mobile...

for iphones safari up to iOS 10 "viewport" is not a solution, i don't like this way, but i have used this javascript code and it helped me document.addEventListener('touchmove', function(event) { event...

View Article

Answer by angry kiwi for How do you disable viewport zooming on Mobile Safari?

user-scalable=0This no longer works on iOS 10. Apple removed the feature.There is no way yo can disable zoom website on iOS now, unless you make gross platform app.

View Article


Answer by jeremypress for How do you disable viewport zooming on Mobile Safari?

@mattis is correct that iOS 10 Safari won't allow you to disable pinch to zoom with the user-scalable attribute. However, I got it to disable using preventDefault on the 'gesturestart' event. I've only...

View Article

Answer by Mattis for How do you disable viewport zooming on Mobile Safari?

For the people looking for an iOS 10 solution, user-scaleable=no is disabled in Safari for iOS 10. The reason is that Apple is trying to improve accessibility by allowing people to zoom on web...

View Article


Answer by ursuleacv for How do you disable viewport zooming on Mobile Safari?

In Safari 9.0 and up you can use shrink-to-fit in viewport meta tag as shown below<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">

View Article

Answer by haltersweb for How do you disable viewport zooming on Mobile Safari?

In order to comply with WAI WCAG 2.0 AA accessibility requirements you must never disable pinch zoom. (WCAG 2.0: SC 1.4.4 Resize text Level AA). You can read more about it here: Mobile Accessibility:...

View Article


Answer by Lorenz Lo Sauer for How do you disable viewport zooming on Mobile...

Try adding the following to your head-tag:<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">additionally<meta...

View Article

Answer by Alex Borsody for How do you disable viewport zooming on Mobile Safari?

sometimes those other directives in the content tag can mess up Apple's best guess/heuristic at how to layout your page, all you need to disable pinch zoom is.<meta name="viewport"...

View Article

Answer by BoltClock for How do you disable viewport zooming on Mobile Safari?

Edit: may not work after iOS 10, please see touch-action based solution below.Your code is displaying attribute double quotes as fancy double quotes. If the fancy quotes are present in your actual...

View Article
Browsing all 21 articles
Browse latest View live




Latest Images