10

The h-screen class which should set the height as the height of the screen doesn’t work on iOS. Is there a way to fix that ?

Pol
  • 985
  • 10
  • 31
  • But what browser on iOS? What version of system, what device? Also it would be good idea to provide some fiddle to tests – chojnicki Apr 19 '20 at 17:26
  • @chojnicki I noticed it on my iPad Pro and iPhone both on safari with the latest iOS/iPadOS. But it appears to affect all mobile devices, check my answer :) – Pol Apr 20 '20 at 18:28

2 Answers2

12

Often i find useful to set a absolute wrapper outside the content with a .inset-0 class

<!-- this will use the whole viewport even in mobile -->
<div class="absolute inset-0">
    <div>
      lorem ipsum
    </div>
</div>
NEOJPK
  • 539
  • 1
  • 6
  • 15
3

The problem is that h-screen uses 100vh as the height. As it’s mentioned in this question, 100vh aims to not work on mobile devices.

But there is a way to tricks it, but it won’t be added to tailwind because it needs JS. To know more about this ‘trick’ check this article : The trick to viewport units on mobile

Pol
  • 985
  • 10
  • 31