-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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 in ArrayInput still not fully solved #7027
Comments
@DjebbZ, |
I'll give it a try soon. I would love to get the final word on this problem. |
We tried hard today, with no luck. The best we could come up with is this, which works perfectly but is even closer to our actual code than our precedent example. https://codesandbox.io/s/beautiful-mestorf-26h9p?file=/src/posts/PostCreateEditForm.tsx. In our code, striping down a similar form to keep only the |
Ok, final answer here. The problem came from our side :) We create custom views and forgot to pass the So far so good ! And no more problem with |
I'm glad you could solve the problem! 💪 |
What you were expecting:
We still have the issue reported in the fake PR #6908, that was supposed to be fixed in RA 3.19.3. The temporary workaround of pinning to a specific version of
final-form
works, but removing this specific version offinal-form
and moving to RA version 3.19.3 did not solve the problem of disappearing values inside<ArrayInput>
s.What happened instead:
To be able to upgrade to 3.19.4 (since it was released since then), we also had to change all
initialValue
props todefaultValue
(at the field level). The combination of RA 3.19.4 +defaultValue
props + removing the specific version offinal-form
is what worked for us to be able to upgrade RA.Steps to reproduce:
Sadly, we didn't manage to create a reproduction case, the one in the PR mentioned above is the closest thing to our production code we could come up with. There must be something we missed, but we can't see what.
Related code:
We did a bit of digging inside RA code and from our understanding, the fix of RA 3.19.3 (#6932) deals with
initialValue
, butdefaultValue
is handled in another code path, which seems to be why usingdefaultValue
works for us and notinitialValue
. I hope this hint can give you enough information to try to track the problem, which seems to be tricky.Link to the original fork in the PR mentioned at beginning.
Environment
The text was updated successfully, but these errors were encountered: