Keyboard ruins layout

Hey there!

I’m facing an annoying problem right now, I’m working on a mobile webapplication on wich the layout of the site changes when changing the device orientation.
I’m using CSS Media Queries to detect the landscape and portrait mode and all of this is working great!

One problem I’m facing right now though is that on my Android phone when I tap an input field wich pops up the keyboard in portrait mode, the css changes to landscape mode as the keyboard kind of takes up most of the vertical space. In this particular case it makes it annoying to fill in form fields…

Any way to counter this behaviour?