Skip to content

Commit

Permalink
Add upgrade guide
Browse files Browse the repository at this point in the history
  • Loading branch information
fzaninotto committed Aug 28, 2019
1 parent 2a06467 commit 2ce4ab9
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -784,4 +784,41 @@ const OrderEdit = (props) => (
</SimpleForm>
</Edit>
);
```
```

## Form Inputs are now filled and dense by default

To better match the [Material Design](https://material.io/components/text-fields/) specification, react-admin defaults to the 'filled' variant for form inputs, and uses a *dense* margin to allow more compact forms. This will change the look and fill of existing forms built with `<SimpleForm>`, `<TabbedForm>`, and `<Filter>`. If you want your forms to look just like before, you need to set the `variant` and `margin` props as follows:

```diff
// for SimpleForm
const PostEdit = props =>
<Edit {...props}>
<SimpleForm
+ variant="standard"
+ margin="normal"
>
// ...
</SimpleForm>
</Edit>;

// for TabbedForm
const PostEdit = props =>
<Edit {...props}>
<TabbedForm
+ variant="standard"
+ margin="normal"
>
<FormTab label="Identity>
// ...
</FormTab>
</TabbedForm>
</Edit>;

// for Filter
const PostFilter = props =>
- <Filter>
+ <Filter variant="standard">
// ...
</Filter>;
```

0 comments on commit 2ce4ab9

Please sign in to comment.