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

ArrayInput wrongly placed Remove button

Open zavadpe opened this issue 8 years ago • 3 comments

What you were expecting: ArrayInput has correct width and Remove button is placed on the right side of the form.

What happened instead: ArrayInput is shorter than expected and Remove button is not placed on the right side of the form.

array_input

Steps to reproduce: Please, refer to the code snippet and Tab 1 in a sandbox linked below.

Related code:

<ArrayInput source="urls">
    <SimpleFormIterator>
        <TextInput source="url" />
    </SimpleFormIterator>
</ArrayInput>

CodeSandbox https://codesandbox.io/s/6n0xlnjzkn

Environment

  • React-admin version: 2.2.x
  • Last version that did not exhibit the issue (if applicable): 2.1.x

zavadpe avatar Aug 30 '18 11:08 zavadpe

ArrayInput is shorter than expected

What is the correct width ? If you want it to take all the space available, add a fullWidth prop on it (You'll have to add a fullWidth prop on its children too). We should document this.

Remove button is not placed on the right side of the form

It is placed at the right side of the input. However, if you set the fullWidth prop as explained above, it will be on the right side of the form.

screenshot

I'll mark this issue as a enhancement to the documentation

djhi avatar Aug 30 '18 13:08 djhi

In my opinion, there is no bug. It's the intended behavior. I don't see why we should explain how to set the fullWidth property here and not in the other input types...

So I'm closing this one.

fzaninotto avatar Aug 30 '18 15:08 fzaninotto

@djhi @fzaninotto Thanks both of you. I missed in documentation that fullWidth can be passed as a prop to Input component, I only tried it in style and options props. Anyway it's working and this is indeed not an issue.

zavadpe avatar Aug 31 '18 08:08 zavadpe