title: iPad Web App: Detect Virtual Keyboard Using JavaScript in Safari?
body: <p>I'm writing a web app for the iPad (<strong>not a regular App Store app</strong> - it's written using HTML, CSS and JavaScript). Since the keyboard fills up a huge part of the screen, it would make sense to change the app's layout to fit the remaining space when the keyboard is shown. However, I have found no way to detect when or whether the keyboard is shown.</p>
  
  <p>My first idea was to assume that the keyboard is visible when a text field has focus. However, when an external keyboard is attached to an iPad, the virtual keyboard does not show up when a text field receives focus.</p>
  
  <p>In my experiments, the keyboard also did not affect the height or scrollheight of any of the DOM elements, and I have found no proprietary events or properties which indicate whether the keyboard is visible.</p>