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.
This commit is contained in:
Aditya Kumar Kasaudhan
2025-06-19 23:15:20 +05:30
committed by Tim Abbott
parent e7859a5564
commit 9b24e54c54
2 changed files with 1 additions and 4 deletions

View File

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

View File

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