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
<ArrayInput source="positions" >
<SimpleIterator >
<DateInput source="delivery_date"/>
<DateInput source="payment_date"/>
</SimpleIterator>
</ArrayInput>
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":
Summary
I think it is a mixed problem:
- React final form doesn't check the return value of getFielState()
- react-admin SimpleFormIterator somehow deletes the fields in a way, that react-final-form still wants to iterate over it,
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
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