You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @bluebill1049 , first of all, thanks for this amazing library, it's been a real pleasure working with it so far.
However recently, we've faced with a minor issue, which affects logic of our apps
Description
As of version 6.14.0 the logic behind dirtyFields and isDirty from useForm / useFormContext seems to be changed quite drastically.
Before 6.14.0 it worked in a following way:
Screen.Recording.2021-01-11.at.18.20.51.mov
But, from 6.14.0 it started working in a completely different way:
Screen.Recording.2021-01-11.at.18.22.38.mov
So, previously we relayed on this behaviour in order to define if user changed anything in the form in order to prevent accidental redirects
you will need to supply defaultValues to make it work correctly with dirty fields. This was fixed by quite a few bugs which is a result of us predicting the default value to be an empty string.
one of the bug below:
🐞 fix #3261 dirtyField with object or array value compare (#3262) merged around Oct 2020
so for isDirty and dirtyFields should always supply a defaultValue for us to do the comparison to avoid issues.
looks like the doc only mentions the need for isDirty, I will include that info in the dirtyFields as well. I know this is not convenient, but as the lib grows we need to seek a more stable and safe approach.
Hi @bluebill1049 , first of all, thanks for this amazing library, it's been a real pleasure working with it so far.
However recently, we've faced with a minor issue, which affects logic of our apps
Description
As of version 6.14.0 the logic behind
dirtyFields
andisDirty
fromuseForm / useFormContext
seems to be changed quite drastically.Before 6.14.0 it worked in a following way:
Screen.Recording.2021-01-11.at.18.20.51.mov
But, from 6.14.0 it started working in a completely different way:
Screen.Recording.2021-01-11.at.18.22.38.mov
So, previously we relayed on this behaviour in order to define if user changed anything in the form in order to prevent accidental redirects
Was it an intentional change of behaviour?
To Reproduce
Steps to reproduce the behaviour:
true
for the altered fieldExpected behaviour
On step 6 "DirtyField" the altered field should be removed from the list of
dirtyField
Desktop (please complete the following information):
If you need any additional info about the reported issue, please, let me know
The text was updated successfully, but these errors were encountered: