mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
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:
committed by
Tim Abbott
parent
e7859a5564
commit
9b24e54c54
@@ -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";
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user