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.

hotkey: Avoid Enter opening compose when modals are open.

Riken Shahe47179fc35d1
diff --git a/static/js/hotkey.js b/static/js/hotkey.js
index f18e7cebc2e..8904b39e1b9 100644
--- a/static/js/hotkey.js
+++ b/static/js/hotkey.js
@@ -433,6 +433,12 @@ export function process_enter_key(e) {
return false;
}
+ // All custom logic for overlays/modals is above; if we're in a
+ // modal at this point, let the browser handle the event.
+ if (overlays.is_modal_open()) {
+ return false;
+ }
+
// If we're on a button or a link and have pressed Enter, let the
// browser handle the keypress
//