When a user taps on a portion of a webpage in a UIWebView
, I trigger a native UIAlertController
asking for a password. This communication is done via the JavaScriptCore
framework, so the creation and presentation of the alert is native.
Unfortunately, once the UIAlertController
with the text box is presented, the keyboard briefly appears and is immediately dismissed. The user can still tap the text box to get the keyboard back. This does not happen when the alert is presented over a normal UIViewController
without a UIWebView
that has focus.
I suspect the UIWebView
is stealing back first responder status after the alert is presented, but I don't know how to stop it.
The alert was previously a UIAlertView
, and exhibited the same behavior on iOS 8. It functioned as expected in iOS 7, and the keyboard was not dismissed upon presentation. I updated to UIAlertController
in the hopes of eliminating this bug, but it looks like it's specific to the UIWebView
+ iOS 8.