From 32f75085cb272ce9966cca197332f7f901d15e84 Mon Sep 17 00:00:00 2001 From: evykassirer Date: Thu, 30 Mar 2023 22:02:50 -0700 Subject: [PATCH] dropdown hot key: Generalize enter behaviour for dropup as well as dropdown. Also updated comment to more accurately represent that this isn't only for the gear menu. --- web/src/hotkey.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/hotkey.js b/web/src/hotkey.js index 08effa1ce1..7c70376fdf 100644 --- a/web/src/hotkey.js +++ b/web/src/hotkey.js @@ -397,8 +397,8 @@ function handle_popover_events(event_name) { // Returns true if we handled it, false if the browser should. export function process_enter_key(e) { - if ($(".dropdown.open").length && $(e.target).attr("role") === "menuitem") { - // on #gear-menu li a[tabindex] elements, force a click and prevent default. + if ($(".dropdown.open, .dropup.open").length > 0 && $(e.target).attr("role") === "menuitem") { + // on dropdown menu 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. e.target.click();