Enhancement request: `formState.dirty`
See original GitHub issueIs your feature request related to a problem? Please describe.
All of our forms will be listening to the formState.dirty
value to show a disabled/enabled save button. The issue I’m currently having is for example I focus an input and blur, the form will be set to dirty
while the value haven’t changed. The same behaviour happens if my default value was “hi” then I set it to “hey” and changed back that value to “hi”.
Describe the solution you’d like
I’d like that the formState.dirty
property correspond to a check of defaultValues
VS current values. If the object doesn’t match then the property is set to true
. That would allow the users to know if they need to save the form because they have changed something while focusing and blurring an input, nothing have changed.
Describe alternatives you’ve considered Is this something I would need to implement on my side or would that be a useful feature enhancement to have on the library?
Thanks
Issue Analytics
- State:
- Created 4 years ago
- Comments:17 (11 by maintainers)
@tombertrand I will update you here once we release the patch, we are blocked by one of the type improvement, once that’s sorted we will let it out 😃
3.22.2-beta.4
did fix the issue with keys containing'
thanks again for your help 👍so I ended up doing