Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Safari Sticky input at bottom unwanted white space

So I have an input at the bottom of my page, positioned like so:

    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;

When I open the keyboard on iOS Safai, there is unwanted whitespace below the input. You can scroll up from it but it shouldn't be there.

Screenshot

The highlighting is from Safari Dev console, I've highlighted HTML, so the extra whitespace is not being caused by my HTML/CSS I think...

This does not happen on Android.

Any Help?

like image 963
Danny Avatar asked Jan 28 '19 18:01

Danny


1 Answers

iOS safari does not respect position: fixed when the input has focus. What seems to be happening is that the element's position attribute is changed to static.

There are a couple aways around this, but the ultimate best answer for now would be to not use fixed.

Additional reading: https://medium.com/@im_rahul/safari-and-position-fixed-978122be5f29

like image 78
Mazzee Avatar answered Oct 24 '22 09:10

Mazzee