react-admin icon indicating copy to clipboard operation
react-admin copied to clipboard

Reactivity of save button with array input

Open kriskw1999 opened this issue 3 years ago • 2 comments

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!

kriskw1999 avatar Aug 09 '22 08:08 kriskw1999

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! 👍

antoinefricker avatar Aug 09 '22 12:08 antoinefricker

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.

fzaninotto avatar Aug 21 '22 06:08 fzaninotto

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.

WiXSL avatar Oct 15 '22 17:10 WiXSL