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.

drafts: Prevent propagation of click event on user mentions.

apoorvapendseea0c21f70327
diff --git a/web/src/user_card_popover.ts b/web/src/user_card_popover.ts
index 6e236b13f0d..87082c7cee1 100644
--- a/web/src/user_card_popover.ts
+++ b/web/src/user_card_popover.ts
@@ -557,12 +557,15 @@ export function unsaved_message_user_mention_event_handler(
this: HTMLElement,
e: JQuery.ClickEvent,
): void {
+ // We stop propagation because, if this event was fired from drafts,
+ // it would otherwise trigger this handler twice: once from the
+ // `.user-mention` listener for drafts and again from the
+ // `.messagebox .user-mention` listener.
+ e.stopPropagation();
if (mouse_drag.is_drag(e)) {
return;
}
- e.stopPropagation();
-
const id_string = $(this).attr("data-user-id")!;
// Do not open popover for @all mention
if (id_string === "*") {