diff --git a/web/src/sidebar_ui.ts b/web/src/sidebar_ui.ts index 14cb08e182..3ed230ef72 100644 --- a/web/src/sidebar_ui.ts +++ b/web/src/sidebar_ui.ts @@ -487,11 +487,17 @@ function all_rows(): JQuery { ".stream-list-section-container.collapsed .topic-list-item:not(.active-sub-filter).bottom_left_row", ); + // Exclude toggle inactive / muted channels row from the list of rows if user is searching. + const $toggle_inactive_or_muted_channels_row = $( + "#streams_list.is_searching .stream-list-toggle-inactive-or-muted-channels.bottom_left_row", + ); + return $all_rows .not($inactive_or_muted_rows) .not($collapsed_views) .not($collapsed_channels) - .not($hidden_topic_rows); + .not($hidden_topic_rows) + .not($toggle_inactive_or_muted_channels_row); } class LeftSidebarListCursor extends ListCursor {