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.
This commit is contained in:
Sayam Samal 2024-10-21 02:43:36 +05:30 committed by Tim Abbott
parent e04e8c3019
commit f7750a07a2
1 changed files with 3 additions and 0 deletions

View File

@ -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() {