From 48e1595a8a8d62b487333c4caff8d6b5b42fb20c Mon Sep 17 00:00:00 2001 From: Pedro Borges Date: Tue, 24 Sep 2024 20:28:38 -0300 Subject: [PATCH] Fix isDirty after form.defaults() call in Vue 3 (#1985) --- packages/vue2/src/useForm.ts | 1 + packages/vue3/src/useForm.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/vue2/src/useForm.ts b/packages/vue2/src/useForm.ts index 3ff255209..0262d8b40 100644 --- a/packages/vue2/src/useForm.ts +++ b/packages/vue2/src/useForm.ts @@ -79,6 +79,7 @@ export default function useForm(...args): InertiaFor if (typeof key === 'undefined') { defaults = this.data() + this.isDirty = false } else { defaults = Object.assign({}, cloneDeep(defaults), value ? { [key]: value } : key) } diff --git a/packages/vue3/src/useForm.ts b/packages/vue3/src/useForm.ts index efdafd87c..2c8fa8095 100644 --- a/packages/vue3/src/useForm.ts +++ b/packages/vue3/src/useForm.ts @@ -79,6 +79,7 @@ export default function useForm( if (typeof fieldOrFields === 'undefined') { defaults = this.data() + this.isDirty = false } else { defaults = Object.assign( {},