The following happens on Mobile Safari iOS 6.1.2
Steps to reproduce
Create a position: fixed
element with an <input type="text">
element inside it.
Actual result
Input - not focused
The position of the fixed elements is correct when input is not focused.
Input - focused
When the input is focused, the browser enters a special mode in which it does not update the position of the fixed elements any more (any fixed positioned element, not just the input's parent) and moves the whole viewport down in order to make the input's parent element sit in the center of the screen.
See live demo: http://jsbin.com/oqamad/1/
Expected result
The position of the fixed elements is always respected.
Fix or workaround?
Any clues as how to force Safari to properly display the fixed elements would be helpful.
I would prefer a workaround which does not involve using position: absolute
and setting an onscroll
event handler.