Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Iphone Keyboard Is Changing Zoom Scale of My Web Site

Anyone know how to prevent the zoom that happens when keyboard/spinner is displayed?

I do know that if you set meta tag viewport content to "user-scalable=no" then this zooming is not being done, but is there any way to prevent this anoying zoom without cutting all zooming functionality for users?

Thanks everybody!

like image 696
M Penades Avatar asked Oct 22 '25 07:10

M Penades


2 Answers

Prevent zooming all together by adding this meta tag to your head tag :

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,user-scalable=0"/>

more solutions: https://blog.osmosys.asia/2017/01/05/prevent-ios-from-zooming-in-on-input-fields/

like image 61
Sunil Shakya Avatar answered Oct 23 '25 22:10

Sunil Shakya


After some testing I found out that depending on viewport size zoom is not made. I mean when having viewport:

 <meta name="viewport"  content="user-scalable=yes, width=280px" />

With no maximum-scale, nor initial-scale, then safari browser wont zoom in when keyboard/spinner is displayed.

I do not understand very well this behaviour, as I would say that logical width to avoid this zooming should be 320px...

I wont mark it as answer, just in case someone wants to add more light to this issue...

like image 37
M Penades Avatar answered Oct 23 '25 21:10

M Penades



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!