| Summary: | calling element.focus() from -[WKWebView evaluateJavaScript:completionHandler:] does not show keyboard | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | jacob berkman <jberkman> |
| Component: | WebKit API | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW --- | ||
| Severity: | Normal | CC: | cathyxz, craig, dbates, ddkilzer, developer, emiel.mols, enrica, james, jonathan, krevis, mikkel_500, mitz, nick, onderceylan, pyanfield, webkit-bug-importer, wenson_hsieh |
| Priority: | P2 | Keywords: | InRadar |
| Version: | 528+ (Nightly build) | ||
| Hardware: | iPhone / iPad | ||
| OS: | iOS 8.2 | ||
|
Description
jacob berkman
2015-03-16 17:22:48 PDT
Hey here, We've run into this same issue with WKWebView at Basecamp (https://basecamp.com) - we'd love for this or some equivalent to UIWebView's keyboardDisplayRequiresUserAction to be added in if possible. There doesn't seem to be any real workarounds so this really impacts our user experience when we want to focus on a web form or contenteditable element. I've managed to work-around this on at least iOS 9 by swizzling _startAssistingNode:userIsInteracting:blurPreviousNode:userObject on WKContentView and overriding the userIsInteracting value:
Pseudo code:
swizzle_intercept("WKContentView", "_startAssistingNode:userIsInteracting:blurPreviousNode:userObject:", &hackAssist);
void hackAssist (id self, SEL _cmd, void* arg0, BOOL arg1, BOOL arg2, id arg3) {
((void (*)(id,SEL,void*,BOOL,BOOL,id))swizzle_interceptee(hackAssist))(self, _cmd, arg0, TRUE, arg2, arg3);
}
Use it to your advantage while the API doesn't change ;). Cheers!
It's not resolved in the latest version iOS 11. I believe this was fixed in iOS 16 beta 6 by: https://bugs.webkit.org/show_bug.cgi?id=243416 |