Skip to content

Commit

Permalink
Do not autofocus on appearence menu
Browse files Browse the repository at this point in the history
  • Loading branch information
yury committed Apr 11, 2020
1 parent d337362 commit d4d08df
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Blink/SmarterKeys/SmarterTermInput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class SmarterTermInput: KBWebView {
override init(frame: CGRect, configuration: WKWebViewConfiguration) {

super.init(frame: frame, configuration: configuration)

// self.allowDisplayingKeyboardWithoutUserAction()
kbView.keyInput = self
kbView.lang = textInputMode?.primaryLanguage ?? ""
Expand Down
5 changes: 5 additions & 0 deletions Blink/TermView.m
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ - (BOOL)canBecomeFirstResponder {
return NO;
}

- (void)setUserInteractionEnabled:(BOOL)userInteractionEnabled {
[super setUserInteractionEnabled:userInteractionEnabled];
[_webView setUserInteractionEnabled:userInteractionEnabled];
}

- (void)_addWebView
{
WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc] init];
Expand Down
6 changes: 4 additions & 2 deletions KB/Native/Views/KBWebViewBase.m
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,10 @@ - (void)_imeGuardDown:(KeyCommand *)cmd {

- (id)_inputDelegate { return self; }
- (int)_webView:(WKWebView *)webView decidePolicyForFocusedElement:(id) info {
return _focused ? 1 : 0;
// return 1;
if (self.userInteractionEnabled) {
return _focused ? 1 : 0;
}
return NO;
}

- (_Bool)_webView:(WKWebView *)arg1 focusShouldStartInputSession:(id)arg2 {
Expand Down

0 comments on commit d4d08df

Please sign in to comment.