marmelab / react-admin

A frontend Framework for single-page applications on top of REST/GraphQL APIs, using TypeScript, React and Material Design
http://marmelab.com/react-admin
MIT License
24.89k stars 5.24k forks source link

Reactivity of save button with array input #8051

Closed kriskw1999 closed 1 year ago

kriskw1999 commented 2 years ago

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!

antoinefricker commented 2 years ago

Thanks for reporting!

Could you integrate this sample in a reproduction sandbox?

Many thanks for your help in this matter! 👍

fzaninotto commented 2 years ago

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.

WiXSL commented 1 year ago

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.