-
-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Nested value of null marks form dirty on init #585
Labels
Comments
Have the same problem. Does anyone have any thoughts on it? |
I noticed you forgot to define the |
Related #531 |
foxhound87
added a commit
that referenced
this issue
Mar 13, 2023
foxhound87
added a commit
that referenced
this issue
Mar 18, 2023
foxhound87
added a commit
that referenced
this issue
Mar 18, 2023
🎉 This issue has been resolved in version 5.5.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I recently updated to the latest version of this library and noticed a new bug where my form
isDirty = true
on initialization.I set values on my form that come back from an API response. Sometimes that value object has a nested object where some properties are
null
. When they are, MobxReactForm marks the form dirty on form initialization. But if those nested values are any other type (string
,boolean
,number
) the form is not marked as dirty. It seems to be only a problem with nested values of typenull
. Top level values ofnull
do not seem to be a problem, only nested ones.Below is an example of the bug. See in the values object, the
account: { id: null }
causes the form to beisDirty = true
on initialization which is a bug. If you change it toaccount: { id: "123" }
or evenaccount: { id: "" }
, we getisDirty = false
on initialization which is correct .The text was updated successfully, but these errors were encountered: