left_sidebar: Improve text selection for topic text.

Fixes: #34959.

Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
This commit is contained in:
apoorvapendse
2025-06-24 21:41:52 +05:30
committed by Tim Abbott
parent 622a125ce4
commit 4288734030
3 changed files with 10 additions and 1 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -1,5 +1,5 @@
<li class="bottom_left_row {{#if is_active_topic}}active-sub-filter{{/if}} {{#if is_zero}}zero-topic-unreads{{/if}} {{#if is_muted}}muted_topic{{/if}} {{#if is_unmuted_or_followed}}unmuted_or_followed_topic{{/if}} topic-list-item" data-topic-name="{{topic_name}}">
<a href="{{url}}" class="topic-box">
<a href="{{url}}" class="topic-box" draggable="false">
<span class="sidebar-topic-check">
{{topic_resolved_prefix}}
</span>