diff --git a/src/components/FormModelPopup.vue b/src/components/FormModelPopup.vue index 98b611743..4dbd1bb44 100644 --- a/src/components/FormModelPopup.vue +++ b/src/components/FormModelPopup.vue @@ -27,10 +27,15 @@ const formModelRef = ref(null); const closeButton = ref(null); const isSaveAndContinue = ref(false); const onDataSaved = (formData, requestResponse) => { - if (closeButton.value && isSaveAndContinue) closeButton.value.click(); + if (closeButton.value && isSaveAndContinue.value) closeButton.value.click(); emit('onDataSaved', formData, requestResponse); }; +const onClick = async () => { + isSaveAndContinue.value = true; + formModelRef.value.save(); +}; + const isLoading = computed(() => formModelRef.value?.isLoading); const reset = computed(() => formModelRef.value?.reset); @@ -78,10 +83,7 @@ defineExpose({ :flat="showSaveAndContinueBtn" :label="t('globals.save')" :title="t('globals.save')" - @click=" - formModelRef.save(); - isSaveAndContinue = false; - " + @click="onClick" color="primary" class="q-ml-sm" :disabled="isLoading" @@ -99,10 +101,7 @@ defineExpose({ :loading="isLoading" data-cy="FormModelPopup_isSaveAndContinue" z-max - @click=" - isSaveAndContinue = true; - formModelRef.save(); - " + @click="onClick" />