From ac652ffab636d0743f0c889734852a9f23807a2a Mon Sep 17 00:00:00 2001 From: Aditya Chaudhary <113302312+userAdityaa@users.noreply.github.com> Date: Thu, 24 Oct 2024 03:36:21 +0530 Subject: [PATCH] stream_settings: Place the cursor automatically in channel name. When the user opens channel create settings from left sidebar, now the focus is set on the channel name input. The logic was already there, but not properly placed inside the overlay code path. Fixes #32034. --- web/src/stream_settings_ui.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/web/src/stream_settings_ui.js b/web/src/stream_settings_ui.js index 7ee0f08f44..39b8b3d739 100644 --- a/web/src/stream_settings_ui.js +++ b/web/src/stream_settings_ui.js @@ -818,14 +818,16 @@ export function launch(section, left_side_tab, right_side_tab) { }, }); change_state(section, left_side_tab, right_side_tab); + setTimeout(() => { + if (!stream_settings_components.get_active_data().id) { + if (section === "new") { + $("#create_stream_name").trigger("focus"); + } else { + $("#search_stream_name").trigger("focus"); + } + } + }, 0); }); - if (!stream_settings_components.get_active_data().id) { - if (section === "new") { - $("#create_stream_name").trigger("focus"); - } else { - $("#search_stream_name").trigger("focus"); - } - } } export function switch_rows(event) {