Open fufaldinav opened 2 months ago
@inertiajs/vue3
The form does not reset isDirty state after calling defaults() and then calling reset() This behavior is observed if there are only primitive values in the form I assume that watcher doesn't see changes and does not change the IsDirty state
watch( form, (newValue) => { form.isDirty = !isEqual(form.data(), defaults) if (rememberKey) { router.remember(cloneDeep(newValue.__remember()), rememberKey) } }, { immediate: true, deep: true }, )
Create a form as in the playground:
const form = useForm('NewUser', { name: '', company: '', role: '', })
Try to change some value
Next, call defaults() and reset(), isDirty will not change its state
https://github.com/inertiajs/inertia/assets/1456499/81c37c7e-c0d9-4c7d-8c5b-9e8e27574674
Version:
@inertiajs/vue3
version: 1.0.6Describe the problem:
The form does not reset isDirty state after calling defaults() and then calling reset() This behavior is observed if there are only primitive values in the form I assume that watcher doesn't see changes and does not change the IsDirty state
Steps to reproduce:
Create a form as in the playground:
Try to change some value
Next, call defaults() and reset(), isDirty will not change its state
https://github.com/inertiajs/inertia/assets/1456499/81c37c7e-c0d9-4c7d-8c5b-9e8e27574674