VIMBindings: only allow if content view is focused
This commit is contained in:
@@ -29,7 +29,7 @@ extension BrowserViewController: VIMBindings
|
|||||||
|
|
||||||
override func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool {
|
override func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool {
|
||||||
if action == #selector(VIMBindings.scrollDownPressed) || action == #selector(VIMBindings.scrollUpPressed) {
|
if action == #selector(VIMBindings.scrollDownPressed) || action == #selector(VIMBindings.scrollUpPressed) {
|
||||||
return webView._currentContentView().isFocusingElement == false
|
return webView._contentViewIsFirstResponder && webView._currentContentView().isFocusingElement == false
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.canPerformAction(action, withSender: sender)
|
return super.canPerformAction(action, withSender: sender)
|
||||||
|
|||||||
Reference in New Issue
Block a user