Skip to content

Commit 48e1595

Browse files
authored
Fix isDirty after form.defaults() call in Vue 3 (#1985)
1 parent a78ed67 commit 48e1595

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

packages/vue2/src/useForm.ts

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export default function useForm<TForm extends FormDataType>(...args): InertiaFor
7979

8080
if (typeof key === 'undefined') {
8181
defaults = this.data()
82+
this.isDirty = false
8283
} else {
8384
defaults = Object.assign({}, cloneDeep(defaults), value ? { [key]: value } : key)
8485
}

packages/vue3/src/useForm.ts

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export default function useForm<TForm extends FormDataType>(
7979

8080
if (typeof fieldOrFields === 'undefined') {
8181
defaults = this.data()
82+
this.isDirty = false
8283
} else {
8384
defaults = Object.assign(
8485
{},

0 commit comments

Comments
 (0)