aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authormrmr19932017-10-29 14:35:36 +0000
committermrmr19932017-10-29 14:55:37 +0000
commitaf74bf84adbe0abcf7fa491f352d31b417c78cd4 (patch)
treedb063eea867e723f878674ff54ad87dc9bc04d62 /lib
parent52bd2cdbf662e3d40c0f5273485379be77ef8c19 (diff)
downloadvimium-af74bf84adbe0abcf7fa491f352d31b417c78cd4.tar.bz2
Suppress all keyup events automatically if we consume the keydown
Diffstat (limited to 'lib')
-rw-r--r--lib/dom_utils.coffee3
-rw-r--r--lib/handler_stack.coffee6
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/dom_utils.coffee b/lib/dom_utils.coffee
index e771d436..b44f5f51 100644
--- a/lib/dom_utils.coffee
+++ b/lib/dom_utils.coffee
@@ -353,7 +353,8 @@ DomUtils =
keyup: (event) ->
return handlerStack.continueBubbling unless event.code == code
@remove()
- handlerStack.suppressEvent
+ DomUtils.suppressEvent event
+ handlerStack.continueBubbling
# We cannot track keyup events if we lose the focus.
blur: (event) ->
@remove() if event.target == window
diff --git a/lib/handler_stack.coffee b/lib/handler_stack.coffee
index 2439f55c..646ddfbd 100644
--- a/lib/handler_stack.coffee
+++ b/lib/handler_stack.coffee
@@ -65,7 +65,11 @@ class HandlerStack
true # Do nothing, but continue bubbling.
else
# result is @suppressEvent or falsy.
- DomUtils.suppressEvent event if @isChromeEvent event
+ if @isChromeEvent event
+ if type == "keydown"
+ DomUtils.consumeKeyup event
+ else
+ DomUtils.suppressEvent event
return false
# None of our handlers care about this event, so pass it to the page.