From fbb05163856d328421df66f089f928baf3d1d476 Mon Sep 17 00:00:00 2001 From: Aditya Kumar Kasaudhan <74228301+Aditya8840@users.noreply.github.com> Date: Sat, 8 Mar 2025 02:27:41 +0530 Subject: [PATCH] compose: Keeps focus on channel picker input during navigation. This commit ensures the hover state appears on the first list item in the channel picker dropdown by default. It enables navigation through the list using Up/Down arrows while keeping browser focus in the text input. The Tab key now shifts focus to the topic input instead of the next list item. Fixes: #33448. --- web/src/compose_recipient.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/src/compose_recipient.ts b/web/src/compose_recipient.ts index 32d832f4f6..46e24cc65c 100644 --- a/web/src/compose_recipient.ts +++ b/web/src/compose_recipient.ts @@ -304,6 +304,13 @@ 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"; + } + return "#private_message_recipient"; + }, }); compose_select_recipient_dropdown_widget.setup();