Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

dropdown_widget: keep_focus_on_search when search is present.

Aditya Kumar Kasaudhan9b24e54c541e
diff --git a/web/src/compose_recipient.ts b/web/src/compose_recipient.ts
index 48a4886a6e0..4a6f3099061 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 e6b6ad98bd6..63adf8899bc 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;
}