From 9b24e54c541ea35c18601f67851c96a001052c47 Mon Sep 17 00:00:00 2001 From: Aditya Kumar Kasaudhan <74228301+Aditya8840@users.noreply.github.com> Date: Thu, 19 Jun 2025 23:15:20 +0530 Subject: [PATCH] dropdown_widget: keep_focus_on_search when search is present. This commit removes the keep_focus_on_search option from the DropdownWidgetOptions type, and updates logic to always set keep_focus_on_search when the search box is visible in the dropdown. Fixes: #34828. --- web/src/compose_recipient.ts | 1 - web/src/dropdown_widget.ts | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/web/src/compose_recipient.ts b/web/src/compose_recipient.ts index 48a4886a6e..4a6f309906 100644 --- a/web/src/compose_recipient.ts +++ b/web/src/compose_recipient.ts @@ -355,7 +355,6 @@ export function initialize(): void { tippy_props: { offset: [-10, 5], }, - keep_focus_on_search: true, tab_moves_focus_to_target() { if (compose_state.get_message_type() === "stream") { return "#stream_message_recipient_topic"; diff --git a/web/src/dropdown_widget.ts b/web/src/dropdown_widget.ts index e6b6ad98bd..63adf8899b 100644 --- a/web/src/dropdown_widget.ts +++ b/web/src/dropdown_widget.ts @@ -78,8 +78,6 @@ export type DropdownWidgetOptions = { // Boolean variable to check whether the dropdown is opened // with a keyboard trigger or not. dropdown_triggered_via_keyboard?: boolean; - // Keep focus on search box while navigation. - keep_focus_on_search?: boolean; // When this is set, pressing tab will move focus to the target element. tab_moves_focus_to_target?: string | (() => string); }; @@ -154,7 +152,7 @@ export class DropdownWidget { options.dropdown_input_visible_selector ?? this.widget_selector; this.prefer_top_start_placement = options.prefer_top_start_placement ?? false; this.dropdown_triggered_via_keyboard = false; - this.keep_focus_on_search = options.keep_focus_on_search ?? false; + this.keep_focus_on_search = !this.hide_search_box; this.tab_moves_focus_to_target = options.tab_moves_focus_to_target; this.current_hover_index = 0; }