Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

dropdown hot key: Generalize enter behaviour for dropup as well as dropdown.

evykassirer32f75085cb27
diff --git a/web/src/hotkey.js b/web/src/hotkey.js
index 08effa1ce1a..7c70376fdf2 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();