inertia
inertia copied to clipboard
Revalidating isDirty when using the defaults() function.
When the form.defaults() function is used, it doesn't update the form.isDirty(), as it is revalidated by a watcher, which is only triggered after a change in the form. I mistakenly called the same validation trigger used in the watcher to revalidate the isDirty() within the defaults() function. This was an error because isDirty() returns false if a field is cleared and then rewritten with the same value after using defaults().
Wow, I need this!
@reinink
This can make sense if you change your defaults to something that is equal to the current form data.
The reset() method already causes to revalidate isDirty so it really is specific to defaults(...).
Would need to be applied to all adapters though. I could help but PRs are already stacking so much so ...