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: Trigger click on target of "trigger-click-on-enter" element.

Sayam Samal405c8f094d84
diff --git a/web/src/hotkey.js b/web/src/hotkey.js
index 58a6cdee90d..5d964537944 100644
--- a/web/src/hotkey.js
+++ b/web/src/hotkey.js
@@ -571,11 +571,11 @@ function handle_popover_events(event_name) {
// Returns true if we handled it, false if the browser should.
export function process_enter_key(e) {
- if ($(e.currentTarget).hasClass("trigger-click-on-enter")) {
+ if ($(e.target).hasClass("trigger-click-on-enter")) {
// If the target has the class "trigger-click-on-enter", explicitly
// trigger a click event on it to call the associated click handler.
e.preventDefault();
- $(e.currentTarget).trigger("click");
+ $(e.target).trigger("click");
return true;
}