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.

left_sidebar: Avoid accidental clicks when dragging over DM pill.

apoorvapendse85bf1799b799
diff --git a/web/src/pm_list.ts b/web/src/pm_list.ts
index fbc61f2c5b6..d393631d4c4 100644
--- a/web/src/pm_list.ts
+++ b/web/src/pm_list.ts
@@ -5,6 +5,7 @@ import * as z from "zod/mini";
import type {Filter} from "./filter.ts";
import {localstorage} from "./localstorage.ts";
+import * as mouse_drag from "./mouse_drag.ts";
import * as pm_list_data from "./pm_list_data.ts";
import type {DisplayObject} from "./pm_list_data.ts";
import * as pm_list_dom from "./pm_list_dom.ts";
@@ -302,7 +303,7 @@ export function initialize(): void {
$(".dm-list").on("click", ".dm-box", (e) => {
// To avoid the click behavior if a dm box is selected.
- if (document.getSelection()?.type === "Range") {
+ if (mouse_drag.is_drag(e)) {
e.preventDefault();
}
});