From 3e1bf86ced565dc684f40979420c07f6ff02c308 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Sun, 27 Aug 2017 16:30:49 -0700 Subject: [PATCH] hotkey: Make enter checks more strict. This should hopefully fix an obscure traceback we were seeing. --- static/js/hotkey.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/hotkey.js b/static/js/hotkey.js index 9f07642913..0f39742990 100644 --- a/static/js/hotkey.js +++ b/static/js/hotkey.js @@ -243,7 +243,7 @@ exports.process_escape_key = function (e) { // Returns true if we handled it, false if the browser should. exports.process_enter_key = function (e) { - if ($(".dropdown.open").length) { + if ($(".dropdown.open").length && $(e.target).attr("role") === "menuitem") { // on #gear-menu li a[tabindex] elements, force a click and prevent default. // this is because these links do not have an href and so don't force a // default action.