-
Notifications
You must be signed in to change notification settings - Fork 358
CB-10376, CB-12037: (ios) Fix bug where WKWebView doesnt respect the KeyboardDisplayRequiresUserAction setting #37
Conversation
@shazron @stevengill any thoughts? |
We appreciate the PR, but ultimately we can't accept it. Please see this thread for a similar PR that uses undocumented/private API: #26 |
I see. But I figured that why we test on the next iOS before it comes out. |
Given a private (unsupported) function cannot be used, does anybody know of any workarounds to force programmatic focus of an input using WKWebView? |
@SeanHub here's what I've learned so far:
Or if you want, you can use my fork and then <plugin name="cordova-plugin-wkwebview-engine" spec="https://github.com/ccorcos/cordova-plugin-wkwebview-engine#e994874583d7e5f4ae1713643dbd8e01c60a0a03" /> |
Since this change just swizzles the WKWebView class, you can make it separate plugin instead of a fork. It might make maintenance easier. Look in #30 for an example. |
@cjpearson really cool. I'll do that. |
I just created a class catalog as a cordova plugin to enable focus on WKWebView. You can install it from https://www.npmjs.com/package/cordova-plugin-wkwebview-inputfocusfix. |
This doesn't work on iOS 11.3 anymore. Our App is half-broken now. Is there any chance someone could fix this? I don't have any exp. swizzling code... |
https://www.npmjs.com/package/cordova-plugin-wkwebview-inputfocusfix works again, like a charm. Thank you very much @hirbod and @onderceylan ! |
Platforms affected
What does this PR do?
This PR does some magic to allow
.focus()
to bring up the keyboard in WKWebView. I read about this approach in a few places and saw this commit in another plugin. From what I understand, its basically accessing a private method in WKWebView.What testing has been done on this change?
Using it on my iPhone 7 and in the Simulator and it definitely works :) I'm not a native developer so I could use some guidance getting this PR to the point where its mergeable. But its definitely useful and absolutely necessary for the app I'm building.
Checklist