Pawan
Pawan

Reputation: 32321

In Phonegap The input is covered by the keyboard once tap the input field

tapping on the text input at the bottom of the page, a virtual keyboard appears (as expected). The problem is that the virtual keyboard overlaps the focused text input. So while I type, I can't see what is being typed. I also cannot scroll down further to the bottom to see the text box, because the page always snaps back up. I am using version of Phonegap 3.5 and jquery 1.9.1

Upvotes: 0

Views: 886

Answers (2)

Amr Bahaa
Amr Bahaa

Reputation: 1157

Add the below preference to config.xml

<preference name="android-windowSoftInputMode" value="adjustResize|stateHidden" />

Upvotes: 0

byJeevan
byJeevan

Reputation: 3838

I solved it by focusin and focusout jquery methods :

//JS : OnReady event:

var windowHeightSeventyPercent = parseInt(screen.height * 0.7); //To support multiple devices

$("input").focusin(function(){
    $("body").height($("body").height()+parseInt(windowHeightSeventyPercent)); //Make page body scroll by adding height to make user to fillup field.
});

$("input").focusout(function(){
  $("body").height($("body").height()-parseInt(windowHeightSeventyPercent));
});

Please refer this thread.

Upvotes: 2

Related Questions