Search code examples
jquerymobile-safarijquery-mobile

Tap screen to close keyboard in jQuery Mobile


We are developing an iPad application with jquery mobile 1.0a4.1.js. We are having some issues with the keyboard. Normal behavior on the ipad is that when a textbox has focus, the keyboard will come up. When you click anywhere in the document the keyboard will close. It seems like with jquery mobile that this behavior is lost. Does anyone have a work around for this? Its annoying that you need to click the close button on the keyboard to get rid of it.


Solution

  • 3 Things come to mind:

    1. Upgrade to the released version (from the jQM alpha)
    2. The keyboard only disappears if the input is no longer in focus - does the input field lose focus when you click elsewhere?
    3. Use rsplak's answer

      $('#input').blur();