From d047a9deea2569ac85cec687e1949406473c8579 Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 6 Feb 2025 09:46:31 +0100 Subject: [PATCH] fix: refs #8372 allow form submission without prevention --- src/boot/qformMixin.js | 2 +- src/components/FormModel.vue | 7 ++++--- src/components/FormModelPopup.vue | 2 +- src/pages/Customer/components/CustomerNewPayment.vue | 3 ++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/boot/qformMixin.js b/src/boot/qformMixin.js index cb31391b3..156d055e7 100644 --- a/src/boot/qformMixin.js +++ b/src/boot/qformMixin.js @@ -44,7 +44,7 @@ export default { return; } evt.preventDefault(); - that.onSubmit(); + that.onSubmit({ ...evt, prevent: false }); } }); }, diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 8a8a4ce8e..c61a055ba 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -113,7 +113,7 @@ const defaultButtons = computed(() => ({ color: 'primary', icon: 'save', label: 'globals.save', - click: () => myForm.value.submit(), + click: () => myForm.value.onSubmit({ prevent: false }), type: 'submit', }, reset: { @@ -202,7 +202,8 @@ async function fetch() { } } -async function save() { +async function save({ prevent = true }) { + if (prevent) return; if ($props.observeFormChanges && !hasChanges.value) return notify('globals.noChanges', 'negative'); @@ -288,7 +289,7 @@ defineExpose({