mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 03:11:54 +00:00
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:
@@ -190,6 +190,8 @@ export function launch(conf: DialogWidgetConfig): void {
|
|||||||
|
|
||||||
// Set up handlers.
|
// Set up handlers.
|
||||||
$submit_button.on("click", (e) => {
|
$submit_button.on("click", (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
if (conf.validate_input && !conf.validate_input(e)) {
|
if (conf.validate_input && !conf.validate_input(e)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user