-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Why form is not 'dirty' after adding/removing object in array? #749
Comments
Shallow equality cannot detect when you change an element inside an array. You need to return a new array without the element you want to remove rather than mutating the existing array. |
You mean, explicitly mutate state in my own handle array methods and do not use
|
In my gist, i use standard methods for adding/removing array elements and i thought, they should return new arrays to change form status to dirty. @erikras is there some sort of best practise for such task? |
+1 for this being implemented. WRT to form dirtiness, if I touch a field, the form is dirty, so why not apply the same at the form level? If I touch the form by adding or removing fields, the form itself should be dirty. |
Please continue the discussion in #391. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I need to save added objects in array & be able to save state, if objects were deleted from array.
In other words, i try to accomplish this behavior:
Please check gist with this example:
https://gist.github.com/olegkalyta/f6623b5c645c22581650
The text was updated successfully, but these errors were encountered: