From 14231e9fe2e33cb7c849c4d1a54d3b66249d7b0a Mon Sep 17 00:00:00 2001 From: apoorvapendse Date: Wed, 25 Jun 2025 12:24:44 +0530 Subject: [PATCH] left_sidebar: Improve text selection in buddy list. Signed-off-by: apoorvapendse --- web/src/click_handlers.ts | 6 ++++++ web/styles/right_sidebar.css | 1 + web/templates/presence_row.hbs | 6 +++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/web/src/click_handlers.ts b/web/src/click_handlers.ts index b08ef36a9a..2c8e826af7 100644 --- a/web/src/click_handlers.ts +++ b/web/src/click_handlers.ts @@ -462,6 +462,12 @@ export function initialize(): void { if ($(e.target).parents(".user-profile-picture").length === 1) { return; } + if (document.getSelection()?.type === "Range") { + // To avoid the click behavior if a user name or status text is + // selected. + e.preventDefault(); + return; + } const $li = $(e.target).parents("li"); diff --git a/web/styles/right_sidebar.css b/web/styles/right_sidebar.css index cd00c46779..d30d3d88fb 100644 --- a/web/styles/right_sidebar.css +++ b/web/styles/right_sidebar.css @@ -356,6 +356,7 @@ } .user-presence-link { + user-select: text; grid-area: row-content; &:hover, diff --git a/web/templates/presence_row.hbs b/web/templates/presence_row.hbs index 2d4ed1a950..908d623ba1 100644 --- a/web/templates/presence_row.hbs +++ b/web/templates/presence_row.hbs @@ -2,7 +2,7 @@