web applications - How do I prevent page from shifting up when soft keyboard appears over text field on Android device? -


i developing web app, nothing more javascript, html , css. have textbox near bottom of page , when clicked in bring soft keyboard on android, shifts entire page up, outside viewport, make visible while entering text on keyboard. after, entire page stays shifted , cannot brought down it's original position.

it client side code adding attributes xml suggested in previous posts don't seem feasible. appreciated.

the android keyboard works differently ios keyboard respect javascript events. think of android keyboard sliding , squeezing contents of page. when happens causes javascript 'orientationchange' event. if have javascript event listener doing things might not want. 1 way work around adjusting css using @media screen.

@media screen , (max-aspect-ratio: 13/9) {    // put portrait settings here }  @media screen , (min-aspect-ratio: 13/9) {    // put landscape settings here } 

with ios, can think of keyboard sliding on top of page not cause 'orientationchange' event.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -