1

I have an input field in my cordova app. When I focus the input field by clicking on it, the window resize function is called on android. On iOS everything works fine. The resizing makes problems because I have a text that is rendered with epub.js and it goes back to the beginning of the current chapter when clicking on that text field.

How can I prevent the resizing?

I tried this, but the problem is still there: Click on input field triggers window resize

HTML:

<form id="realPageInputForm" ng-submit="goToRealPage(inputPage)">
     <input ng-model-options="{ getterSetter: true }"     
           id="realPageInput" 
           class="inputPage input-label" 
           type="number" 
           name="inputPage" 
           ng-model="inputPage" 
           placeholder="Enter page here">
</form>
Community
  • 1
  • 1
chocolate cake
  • 2,129
  • 5
  • 26
  • 48

1 Answers1

2

It happens beacuse when you click on that input, the keyboard appears and, in android, keyboard make your view smaller (screen size is shared between your app and the keyboard); and when keyboard hides the webview recover again their original size. You can check on other answers to questions similar to yours, like PhoneGap: Is there a way to stop the keyboard from resizing the view?.

Juan Miguel S.
  • 591
  • 2
  • 11