mirror of
https://github.com/zulip/zulip.git
synced 2025-11-21 15:09:34 +00:00
dialog_widget: Fix race focusing submit button.
Opening the modal before adding the on_shown handler makes it possible that the modal could full appear before the handler runs.
This commit is contained in:
@@ -131,12 +131,12 @@ export function launch(conf) {
|
|||||||
dialog.remove();
|
dialog.remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Open the modal
|
|
||||||
overlays.open_modal("#dialog_widget_modal");
|
|
||||||
|
|
||||||
if (conf.focus_submit_on_open) {
|
if (conf.focus_submit_on_open) {
|
||||||
conf.parent.on("shown.bs.modal", () => {
|
conf.parent.on("shown.bs.modal", () => {
|
||||||
submit_button.trigger("focus");
|
submit_button.trigger("focus");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Open the modal
|
||||||
|
overlays.open_modal("#dialog_widget_modal");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user