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.

user_groups: Avoid triggering popover on mention selection.

apoorvapendsea7ff80dfc3af
diff --git a/web/src/user_group_popover.ts b/web/src/user_group_popover.ts
index 16e0bb2d048..b69ce4350e8 100644
--- a/web/src/user_group_popover.ts
+++ b/web/src/user_group_popover.ts
@@ -8,6 +8,7 @@ import * as blueslip from "./blueslip.ts";
import * as buddy_data from "./buddy_data.ts";
import * as hash_util from "./hash_util.ts";
import * as message_lists from "./message_lists.ts";
+import * as mouse_drag from "./mouse_drag.ts";
import * as people from "./people.ts";
import type {User} from "./people.ts";
import * as popover_menus from "./popover_menus.ts";
@@ -147,6 +148,9 @@ export function toggle_user_group_info_popover(
export function register_click_handlers(): void {
$("#main_div").on("click", ".user-group-mention", function (this: HTMLElement, e) {
e.stopPropagation();
+ if (mouse_drag.is_drag(e)) {
+ return;
+ }
const $elt = $(this);
const $row = $elt.closest(".message_row");
@@ -187,6 +191,9 @@ export function register_click_handlers(): void {
// that run before this one and call stopPropagation.
$("body").on("click", ".messagebox .user-group-mention", function (this: HTMLElement, e) {
e.stopPropagation();
+ if (mouse_drag.is_drag(e)) {
+ return;
+ }
toggle_user_group_info_popover(this, undefined);
});