-
-
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: DateInput & ArrayInput - formatOnBlur triggers undefined ref in react-final-form #6459
Comments
Thanks for reporting this. As I can't reproduce this issue on our simple example (see the posts edit which has an ArrayInput with DateInputs), please provide a sample application showing the issue by forking the following CodeSandbox (https://codesandbox.io/s/github/marmelab/react-admin/tree/master/examples/simple). |
Many Many thanks for your template! This helped me alot! https://codesandbox.io/s/infallible-goldberg-4pgb7?file=/src/posts/PostEdit.tsx Steps to reproduce --> Nothing happens EDIT: EDIT 2:
|
Do you need more information or can I help somehow? I'm still not sure, that formatOnBlur: false, is the right solution? |
What information do you need? Please tell me. I have the above change of |
Thanks for the sandbox. We need to investigate and see if we can do something about it. In the mean time, your workaround looks correct. |
@djhi, could this be closed? |
Indeed, it should be |
Dear Team,
many thanks for react-admin and your work!
Version
"react": "^16.7.0",
"react-admin": "^3.17.0",
"react-scripts": "4.0.3",
Code Basis of bug
Problem
If you have multiple array elements and delete an array element in the middle by clicking on the delete button,
the EDIT form is not submitted/saved when clicking on the EDIT save button.
Observation
The browser console reports
Looking at the code it is that following react-final-form code which is triggered:
https://github.com/final-form/react-final-form/blob/2d9e7129f40efd39450c1d581956e8cfce17a20a/src/useField.js#L68
This only happens in react-admin for datefields, as datefields set "formatOnBlur":
react-admin/packages/ra-ui-materialui/src/input/DateInput.tsx
Line 68 in cec6894
Summary
I think it is a mixed problem:
although they are deleted?
I would really appreciate a fix, I have no idea how to proceed. With your help I can also offer to fix it myself,
but I'm lost. Is it react-final-form or is it react-admin which causes this?
Regards,
Daniel
The text was updated successfully, but these errors were encountered: