Skip to content

Commit

Permalink
fix(iOS): hideKeyboardAccessoryView on iPads (#661)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimapaloskin authored and Titozzz committed Sep 26, 2019
1 parent fd83655 commit 09372c9
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions ios/RNCWebView.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,22 @@

// runtime trick to remove WKWebView keyboard default toolbar
// see: http://stackoverflow.com/questions/19033292/ios-7-uiwebview-keyboard-issue/19042279#19042279
@interface _SwizzleHelperWK : NSObject @end
@interface _SwizzleHelperWK : UIView
@property (nonatomic, copy) WKWebView *webView;
@end
@implementation _SwizzleHelperWK
-(id)inputAccessoryView
{
return nil;
if (_webView == nil) {
return nil;
}

if ([_webView respondsToSelector:@selector(inputAssistantItem)]) {
UITextInputAssistantItem *inputAssistantItem = [_webView inputAssistantItem];
inputAssistantItem.leadingBarButtonGroups = @[];
inputAssistantItem.trailingBarButtonGroups = @[];
}
return nil;
}
@end

Expand Down

0 comments on commit 09372c9

Please sign in to comment.