-
-
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
Pristine remains true after adding fields to deep form array. #391
Comments
Great question. It is that way, but not by intentional design. In other words, I hadn't really considered that aspect of form dirtiness. |
In /examples/deep doesn't |
It does, but |
If I have a child previously saved, I open the form again and add a bunch of empty awards it looks like it would submit I'd vote since the value of something (albeit a deeply nested one) changes the form is dirty. This deep form business is no easy thing... |
Maybe it should be I dunno man. Forget I brought it up. 😜 |
This is showing up for me (though in a reversed fashion) with a field that stores its value as an object. The initialValue and the value are in fact the same, but since !== checks reference with objects, I'm assuming that when redux-form moves the initialValue to value it is cloning the object (as it should) and reference changes. It would seem that for the pristine/dirty system to be more reliable it will need to do deep comparison based on type. |
👍 for deep child comparisons. issue #1: #2: I have the same two children from backend. I remove a child. When I add new, I now see the data show up for the removed child, instead of seeing new, empty row added. Looking at the online example, you can recreate #1 by adding new child(ren) and hit clear button. The child rows are still present, even if fields are empty. I would assume clearing the form would reset it to initial state of no children. |
👍 This issue is also present when you remove an array item that is present in the form's |
👍 |
👍 |
I'd also like to vote that adding/removing a field should be considered a change to the overall form data and as such, the form should be marked dirty. |
It still doesn't set |
Bumping this. Should definitely be dirty after add/remove field. |
In the meantime, I'll share a hack that I came up with in case it helps anyone. I just added a pseudo field
|
- Deep forms updated to address redux-form issue: redux-form/redux-form#391
Unfortunately this bug is part of Redux Form for such a long time that fixing it would result in a mass breakage because consumers had to rely on this clumsy behavior. However it has been fixed in Redux Form v6. |
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. |
The
pristine
property remainstrue
after usingaddField(value?, index?)
to a deep form. Is this intentional or a bug?The text was updated successfully, but these errors were encountered: