Having a page zoom out on mobile

Not sure how to title this properly, but hopefully this description will help clarify.

On mobile, when selecting an input element from a dropdown, the page will zoom in slightly to highlight the input box. This is done automatically. What I want to do is then, on a button click or on input blur have the page un-zoom and essentially look as it did when it was first loaded. I need to do this, however, without actually reloading the page as it would create for a poor user experience.

Is there any way to accomplish this “un-zooming”? I tried using

wixWindow.scrollTo(0,0) 

but this simply drags to user to the top left corner without “un-zooming” them. They stay slightly zoomed in and it essentially ruins the experience and functionality of the page.

Any work arounds would be amazing!

Thanks!!

Hi there :raised_hand_with_fingers_splayed:

The zooming is done by your mobile browser, I don’t think the website has anything to do with it. Try different browsers / phones and see it persist.

So no way to reset the viewport?

Maybe I could add a meta tag like:

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

Or would this not be supported by Wix?

For those interested, I found a cool workaround :slight_smile:

The iPhone will zoom back out if an input field has 16pt font or higher. If you put a read only input field set to default text (with no text in it), have a 0% opacity border and background on all settings (regular, hover, error, disabled, etc), and make the font size 16 on mobile, it will zoom the page back out, undoing the annoying zoom that occurs when font size is less than 12pts.

You can then overlap the input field on top of your button and add an onClick handler and copy the button’s onClick code. It will work the same and will not visually impact your page at all :slight_smile:

If the explanation was confusing, please reply to me and I’ll try my best to clarify.

Add this to tracking tools:

Thanks for posting your workaround, helped a lot!