-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor how hiding the accessory bar works. Relates to #3
- Loading branch information
Showing
2 changed files
with
17 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9fc1f2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this change
hideFormAccessoryBar(true)
no longer works with the WKWebView Cordova plugin, because WKWebView does not use theUIWebBrowserView
class.Looks like with the previous code the plugin would attach observers to the keyboard events and then look for the affected webview instance and apply the change there. Now the change is applied to the webview class which does not account for pluggable webviews (or the WKWebView). I tried changing
Class webBrowserClass = NSClassFromString(@"UIWebBrowserView");
toClass webBrowserClass = self.webView.class;
to get the class of the instance, but that didn't work.Do you have any suggestions for correcting this problem?
9fc1f2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the dumped iOS 9 headers, it seems WKContentView also has the inputAccessoryView property. Swizzling the method on that class instead of (or in addition to) UIWebBrowserView may work.
9fc1f2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could try this code that swizzles both the UIWebView and WKWebView implementations. It seems to work for me in a quick test.
9fc1f2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @cjpearson! I'll give it a try later today.
9fc1f2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any luck with this?
9fc1f2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andreialecu, I've checked this change into master. If you install the plugin from github it should work
9fc1f2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works nicely now. Thanks!