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.

click: Revert getSelection() check to determine link selection.

apoorvapendseddbaf7c6ac87
diff --git a/web/src/click_handlers.ts b/web/src/click_handlers.ts
index 33d3e216798..68667083d5f 100644
--- a/web/src/click_handlers.ts
+++ b/web/src/click_handlers.ts
@@ -965,13 +965,10 @@ export function initialize(): void {
if (compose_state.composing() && $(e.target).parents("#compose").length === 0) {
const is_click_within_link = $(e.target).closest("a").length > 0;
if (is_click_within_link || $(e.target).closest(".copy_codeblock").length > 0) {
- const is_selecting_link_text =
- is_click_within_link &&
- (mouse_drag.is_drag(e) || document.getSelection()?.type === "Range");
+ const is_selecting_link_text = is_click_within_link && mouse_drag.is_drag(e);
if (is_selecting_link_text) {
// Avoid triggering the click handler for a link
- // when just dragging over it to select the text or
- // double/triple clicking it to select link text.
+ // when just dragging over it to select the text.
e.preventDefault();
return;
}