Skip to content

Commit

Permalink
Display errors on mui BootstrapInput
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Lelaisant committed Apr 10, 2019
1 parent 089dc3e commit 3883d99
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/ra-ui-materialui/src/input/BooleanInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types';
import FormControlLabel from '@material-ui/core/FormControlLabel';
import FormGroup from '@material-ui/core/FormGroup';
import FormHelperText from '@material-ui/core/FormHelperText';
import Switch from '@material-ui/core/Switch';
import { addField, FieldTitle } from 'ra-core';

Expand All @@ -23,6 +24,7 @@ export class BooleanInput extends Component {
resource,
options,
fullWidth,
meta,
...rest
} = this.props;

Expand Down Expand Up @@ -51,6 +53,13 @@ export class BooleanInput extends Component {
/>
}
/>
{meta.error
? meta.error.map((error, index) => (
<FormHelperText key={index} error>
{error}
</FormHelperText>
))
: null}
</FormGroup>
);
}
Expand Down

0 comments on commit 3883d99

Please sign in to comment.