From f7750a07a2481fc1d039a19c93932db67dedd44c Mon Sep 17 00:00:00 2001 From: Sayam Samal Date: Mon, 21 Oct 2024 02:43:36 +0530 Subject: [PATCH] modals: Fix focus advancement in move topic modal. Previously, when selecting a new channel in the "move topic" modal using the keyboard, focus failed to advance to the topic input automatically. Users had to press the tab key an extra time to move focus to the topic input, which was not the intended behavior. This commit modifies the `move_topic_on_update` function in `web/src/stream_popover.js` to explicitly set focus on the topic input field after a channel is selected. --- web/src/stream_popover.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/src/stream_popover.js b/web/src/stream_popover.js index 7623a16976..4157eb6e99 100644 --- a/web/src/stream_popover.js +++ b/web/src/stream_popover.js @@ -547,6 +547,9 @@ export async function build_move_topic_to_stream_popover( dropdown.hide(); event.preventDefault(); event.stopPropagation(); + + // Move focus to the topic input after a new stream is selected. + $("#move_topic_form .move_messages_edit_topic").trigger("focus"); } function move_topic_post_render() {