From d14caa8400cb0d35d7295961a376b9d8c19b2401 Mon Sep 17 00:00:00 2001 From: Lalit Date: Sun, 25 Jun 2023 10:11:27 +0530 Subject: [PATCH] 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 --- web/src/dialog_widget.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/src/dialog_widget.ts b/web/src/dialog_widget.ts index 78a173f02e..6915b7a273 100644 --- a/web/src/dialog_widget.ts +++ b/web/src/dialog_widget.ts @@ -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; }