Tailwindcss: Form fields zoom on focus

Created on 28 Oct 2019  路  3Comments  路  Source: tailwindlabs/tailwindcss

Hi Adam, first of all, I thank you two for the excellent work on tailwind.
I notice on mobile/safari when you focus on a field the browser zooms in a little and extends the width of the page, please see the images of tailwind and B4. I wonder if there's a way to disable this

Appreciate any help,
Regards

IMG_2802

IMG_2801

IMG_2800

Most helpful comment

I had the same issue, solved it by using the solution in the tweet @hacknug suggested.

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover"></meta>

Hope it helps someone.

All 3 comments

That's expected behaviour. Safari Mobile (and other mobile browsers) zoom in when focusing inputs with a font-size smaller than 16px.

Take a look at this tweet where I mentioned how to prevent this behavior the other day. Please make sure to read @lucalanca's comments regarding accessibility before you use it on production sites.

Also not an issue with Tailwind's core, better suited for docs or discuss.

Yep default browser behavior, if you don't want it to zoom use a font size of at least 16px in your own form fields 馃憤

I had the same issue, solved it by using the solution in the tweet @hacknug suggested.

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover"></meta>

Hope it helps someone.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

divdax picture divdax  路  3Comments

jbardnz picture jbardnz  路  3Comments

lamberttraccard picture lamberttraccard  路  3Comments

ghost picture ghost  路  3Comments

AlexVipond picture AlexVipond  路  3Comments