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.
This commit is contained in:
Aditya Chaudhary 2024-10-24 03:36:21 +05:30 committed by GitHub
parent c1fc8e6331
commit ac652ffab6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 7 deletions

View File

@ -818,14 +818,16 @@ export function launch(section, left_side_tab, right_side_tab) {
}, },
}); });
change_state(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) { export function switch_rows(event) {