react-admin
react-admin copied to clipboard
Reactivity of save button with array input
Bug
The main issue that I am facing with RA4 is that having an array input with any kind of input in the edit view if I change the value of the input the save button on the bottom remains still disabled.
Minimal scenario
Here below is the form part in a edit. The code itself works well I am able to send correct requests to my API, but the save BTN remains disabled like it is not able to notice that the field of source number was changed.
<Edit>
<SimpleForm>
<ArrayInput source="numbers" defaultValue={[{ number: 1 }]}>
<SimpleFormIterator>
<NumberInput source="number" defaultValue={1} />
</SimpleFormIterator>
</ArrayInput>
</SimpleForm>
</Edit>
Thanks a lot for the support!
Thanks for reporting!
Could you integrate this sample in a reproduction sandbox?
- a CodeSandbox simple example V4
- or a Stackblitz [simple example V4] (https://stackblitz.com/github/marmelab/react-admin/tree/master/examples/simple)
- or a link to a GitHub repo with the minimal codebase to reproduce the issue?
Many thanks for your help in this matter! 👍
I cannot reproduce the problem on master: https://stackblitz.com/edit/github-oncmb9?file=src%2Fposts%2FPostEdit.tsx (edit the first post in the list).
https://user-images.githubusercontent.com/99944/185777930-77a038c3-713e-4200-a3d7-1673f33f8594.mov
Maybe the problem was fixed in 4.2.6, or it is in your code.
Unless you can link to a reproduction based on my StackBlitz above, we'll close this issue within a few weeks.
No news for some time. Closing. If you find a way to reproduce this issue, please be sure to let us know by following the issue template.