I'm experimenting with PhoneGap, and my HTML starts with:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="user-scalable=no, initial-scale=1, minimum-scale=1, maximum-scale=1, width=device-width, height=device-height" />
Later in the HTML I have an input text field. Normally, web view scrolls up when the input field gets focus and the keyboard is shown. However, in my case the keyboard covers the view and it does not scroll up (as I want it to).
If I remove the above <meta name="viewport" ...>
tag, the view does scroll up but also sideways and also becomes scalable (which I don't want).
How can I get the desired behavior of keyboard (and only keyboard) pushing the view up (and only up) on both Android and iOS?
EDIT
I've found a similar case in Get viewport height when soft keyboard is on -- I also have some fixed div with width and height set 100%:
.main {position:fixed; top:0; left:0; width:100%; height:100%;}
However, if I simply modify the positioning to static
, the view is not "pushed" up but rather "squeezed" up... Not the desired behavior.