From 428873403002616d3180726a5c7f836c4b3b41f6 Mon Sep 17 00:00:00 2001 From: apoorvapendse Date: Tue, 24 Jun 2025 21:41:52 +0530 Subject: [PATCH] left_sidebar: Improve text selection for topic text. Fixes: #34959. Signed-off-by: apoorvapendse --- web/src/topic_list.ts | 5 +++++ web/styles/left_sidebar.css | 4 ++++ web/templates/topic_list_item.hbs | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/web/src/topic_list.ts b/web/src/topic_list.ts index ba8ef0b177..a99cba8f31 100644 --- a/web/src/topic_list.ts +++ b/web/src/topic_list.ts @@ -610,6 +610,11 @@ export function initialize({ return; } + if (document.getSelection()?.type === "Range") { + // To avoid the click behavior if a topic link is selected. + e.preventDefault(); + return; + } const $stream_row = $(e.target).parents(".narrow-filter"); const stream_id_string = $stream_row.attr("data-stream-id"); assert(stream_id_string !== undefined); diff --git a/web/styles/left_sidebar.css b/web/styles/left_sidebar.css index 3dedd90ce7..ff695de620 100644 --- a/web/styles/left_sidebar.css +++ b/web/styles/left_sidebar.css @@ -1654,6 +1654,10 @@ li.active-sub-filter { } } +.topic-box { + user-select: text; +} + .searching-for-more-topics { margin-left: var(--left-sidebar-toggle-width-offset); height: var(--line-height-sidebar-row-prominent); diff --git a/web/templates/topic_list_item.hbs b/web/templates/topic_list_item.hbs index 3e4b35b4d2..30d170a1f6 100644 --- a/web/templates/topic_list_item.hbs +++ b/web/templates/topic_list_item.hbs @@ -1,5 +1,5 @@
  • - + {{topic_resolved_prefix}}