Skip to content

Commit

Permalink
Fix isDirty after form.defaults() call in Vue 3 (#1985)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroborges authored Sep 24, 2024
1 parent a78ed67 commit 48e1595
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/vue2/src/useForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export default function useForm<TForm extends FormDataType>(...args): InertiaFor

if (typeof key === 'undefined') {
defaults = this.data()
this.isDirty = false
} else {
defaults = Object.assign({}, cloneDeep(defaults), value ? { [key]: value } : key)
}
Expand Down
1 change: 1 addition & 0 deletions packages/vue3/src/useForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export default function useForm<TForm extends FormDataType>(

if (typeof fieldOrFields === 'undefined') {
defaults = this.data()
this.isDirty = false
} else {
defaults = Object.assign(
{},
Expand Down

0 comments on commit 48e1595

Please sign in to comment.