postcss-100vh-fix icon indicating copy to clipboard operation
postcss-100vh-fix copied to clipboard

Fix without media query

Open fregante opened this issue 5 years ago • 8 comments

body {
  height: 100vh;
}

should be fixed to

body {
  height: 100vh;
  height: -webkit-fill-available;
}

-webkit-fill-available is automatically ignored by browsers that don't understand it.

fregante avatar Jul 23 '20 09:07 fregante

It causes issues in Chrome: https://allthingssmitty.com/2020/05/11/css-fix-for-100vh-in-mobile-webkit/#comment-4910262284

When I first load this page in Chrome on Android, the MAIN element is several screens large for some reason, and I have to scroll down to get to the footer (first screenshot). But then when I pull-to-refresh, the page renders correctly (second screenshot).

simevidas avatar Aug 09 '20 01:08 simevidas

Does the snippet used on CSS Tricks solve the issue?

body {
  min-height: 100vh;
  min-height: -webkit-fill-available;
}
html {
  height: -webkit-fill-available;
}

kripod avatar Aug 16 '20 17:08 kripod

@kripod It renders correctly in Chrome on my simple demo page: https://output.jsbin.com/noqasek/quiet.

But there is a problem in the new Firefox. The footer is behind the URL bar:

Screenshot_20200816-204001

simevidas avatar Aug 16 '20 18:08 simevidas

Thanks for the quick feedback! I’ll resort to a media query solution for now, then…

kripod avatar Aug 16 '20 19:08 kripod

@simevidas I've just reported this bug towards Firefox for Android developers. Could you please comment about the Android device and Fenix version you're using over there?

kripod avatar Aug 16 '20 19:08 kripod

image

media query solution seem not work

NullYing avatar Feb 01 '21 04:02 NullYing

@kripod Sorry for the late response. The issue is still present in Firefox stable (85.1.1) on Moto G4. It’s an older device, so maybe that’s a factor. Could you share the link to the bug report? I’m curious if/how Mozilla responded.

simevidas avatar Feb 01 '21 06:02 simevidas

@simevidas the report is available right here.

kripod avatar Feb 02 '21 08:02 kripod