isDirty should align with other libraries #1081
-
Here's an example using Tanstack Form. The docs specify:
But there's no explanation of the reason for this choice. But it was apparently unusual enough to warrant its own note in the docs. If For most if not all form libraries I've used, the expected behavior is the form is not dirty when the default values is equal. See formik example here: Perhaps it would be appropriate to |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 11 replies
-
I really think the current behavior of I mean, if Therefore, the current behavior of |
Beta Was this translation helpful? Give feedback.
-
i just run into this and think there should be a way to check for a changed form state. Either change isDirty or add isModified or isChanged as alexqhj suggested. |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
Yes, the current state does not make sense. isDirty should never be true when currentValues === defaultValues. Then it's simply not dirty. It is clean as a whistle. |
Beta Was this translation helpful? Give feedback.
-
@alexqhj I'm working on this now, hopefully will have a PR ready by the end of the day 🤟 How dose this sound |
Beta Was this translation helpful? Give feedback.
-
@alexqhj how dose this do? feel free to leave a review over at #1456 |
Beta Was this translation helpful? Give feedback.
-
#1456 was just merged giving you access to The docs are here. We'd love to hear some feedback😄 |
Beta Was this translation helpful? Give feedback.
#1456 was just merged giving you access to
meta.isDefaultValue
which if you do something like!meta.isDefaultValue
will give you the reacts ecosystems isDirty.The docs are here. We'd love to hear some feedback😄