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.

stream_list: Avoid accidental clicks while dragging stream.

apoorvapendsea5cd9595eee9
diff --git a/web/src/stream_list.ts b/web/src/stream_list.ts
index e472b6829e0..8f137623c87 100644
--- a/web/src/stream_list.ts
+++ b/web/src/stream_list.ts
@@ -21,6 +21,7 @@ import * as hash_util from "./hash_util.ts";
import {$t} from "./i18n.ts";
import * as left_sidebar_navigation_area from "./left_sidebar_navigation_area.ts";
import {localstorage} from "./localstorage.ts";
+import * as mouse_drag from "./mouse_drag.ts";
import * as narrow_state from "./narrow_state.ts";
import * as pm_list from "./pm_list.ts";
import * as popovers from "./popovers.ts";
@@ -1334,12 +1335,12 @@ export function set_event_handlers({
if (e.metaKey || e.ctrlKey || e.shiftKey) {
return;
}
- if (document.getSelection()?.type === "Range") {
+
+ if (mouse_drag.is_drag(e)) {
// To avoid the click behavior if a channel name is selected.
e.preventDefault();
return;
}
-
const stream_id = stream_id_for_elt($(e.target).parents("li.narrow-filter"));
on_sidebar_channel_click(stream_id, e, show_channel_feed);
});