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.

message_select: Fix text selection not working for clicks.

apoorvapendse4b9bccbd1b05
diff --git a/web/src/click_handlers.ts b/web/src/click_handlers.ts
index 0eb34be1493..58f5b329435 100644
--- a/web/src/click_handlers.ts
+++ b/web/src/click_handlers.ts
@@ -190,9 +190,14 @@ export function initialize(): void {
return;
}
+ if (document.getSelection()?.type === "Range") {
+ // Drags and double/triple clicks on the message
+ // (to copy message text) shouldn't trigger a reply.
+ return;
+ }
+
if (mouse_drag.is_drag(e)) {
- // Drags on the message (to copy message text) shouldn't trigger a reply.
- // This also prevents triggering a reply when you click and drag through
+ // This prevents triggering a reply when you click and drag through
// an area that doesn't contain text.
return;
}