dialog_widget: Prevent default action when submitting the form.

We should prevent the default html behavior when submitting the forms
in the dialog_widgets to avoid reloading the whole page when the user
clicks the submit button.

Fixes: #26104
This commit is contained in:
Lalit
2023-06-25 10:11:27 +05:30
committed by Tim Abbott
parent 76b767b154
commit d14caa8400

View File

@@ -190,6 +190,8 @@ export function launch(conf: DialogWidgetConfig): void {
// Set up handlers.
$submit_button.on("click", (e) => {
e.preventDefault();
if (conf.validate_input && !conf.validate_input(e)) {
return;
}