Skip to content

Commit

Permalink
Merge pull request #2176 from inertiajs/fix-form-helper-defaults
Browse files Browse the repository at this point in the history
Fix for default object in useForm
  • Loading branch information
joetannenbaum authored Jan 9, 2025
2 parents 59ee7aa + 759161a commit 50f0ffb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vue3/src/useForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default function useForm<TForm extends FormDataType>(
return this
},
reset(...fields) {
const resolvedData = typeof data === 'function' ? cloneDeep(data()) : cloneDeep(data)
const resolvedData = typeof data === 'function' ? cloneDeep(data()) : cloneDeep(defaults)
const clonedData = cloneDeep(resolvedData)
if (fields.length === 0) {
defaults = clonedData
Expand Down

0 comments on commit 50f0ffb

Please sign in to comment.