2

I'm working on a phonegap app that uses an iframe to embed an already mobile friendly webapp. In the webapp there is a search function that focuses a text field which reveals the virtual keyboard. So far everything is good...

However, I'm using a library that registers a touchstart listener on the document (the one inside the iframe). So if while the virtual keyboard is showing the user touches in the document the keyboard stops working.

From an ipad (or the ipad simulator in XCode... I've tested on 7.0.3) go here and follow the instructions: https://s3.amazonaws.com/ypassets-andy/app-frame.html

The interesting thing is is that if you don't wrap it in an iframe the keyboard doesn't break. Go here: https://s3.amazonaws.com/ypassets-andy/app.html and follow the instructions to see it NOT break.

I've been banging my head on this but can't figure out how to get this thing working. For reference these stack exchange posts seem related but I couldn't the issue with them:

Thanks for any ideas!

Andy

Community
  • 1
  • 1
aharbick
  • 21
  • 4

1 Answers1

2

This seems to be an unfiled iOS bug. The only fix is to move the inputs from the iframe into the main document.

Longer story:

Andy, tried to solve this one but ultimately failed (was for a login/settingsdialog in a modal). It nearly killed me to never find out, but maybe it's a good Zen exercise. Here's what we eliminated/tried:

  • iframe not being focused/focus on different document
  • completely blurring everything before setting focus
  • setRange etc instead of focus
  • handbuild and fire events within the touchstart stack
  • check if event fires multiple times
  • see if css properties like user-select or touch-callout make any difference

All that final assumption was that it's somehow related Webkits "scroll inputs into view" logic that got some updates in iOS 7.

Bruno
  • 679
  • 10
  • 16
  • I think I found a couple of reported instances, sadly no resolution just yet. http://openradar.appspot.com/radar?id=2527401 http://bugs.jqueryui.com/ticket/9737 – Christoffer Jul 15 '14 at 09:26