First edit does not set dirty flag #10967
Unanswered
geertjanvdk
asked this question in
General
Replies: 1 comment
-
Please share a minimal reproducible codesandbox url. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The first edit of my forms never set the the dirty flag: not on form level, or field level. Whether I am using zod or yup, it does not matter.
The 2nd edit, then all is fine and even the first field is considered dirty, which I find very odd..
The only workaround I have now used for months is to do the following in every component using
useForm
, simply calling it once:For example:
It doesn't not matter whether I have defaults not. zod or yup, same result (I had to go yup because of other reasons). Schema has
.default("")
on each of the fields. Validation works nicely.Just wondering why it is.. And whether I have to keep that hack in each component.
Beta Was this translation helpful? Give feedback.
All reactions