diff --git a/lib/Select.js b/lib/Select.js index a09bab1b..b7e6d048 100644 --- a/lib/Select.js +++ b/lib/Select.js @@ -26,6 +26,10 @@ var _FormControl = require("@material-ui/core/FormControl"); var _FormControl2 = _interopRequireDefault(_FormControl); +var _FormHelperText = require("@material-ui/core/FormHelperText"); + +var _FormHelperText2 = _interopRequireDefault(_FormHelperText); + var _ComposedComponent = require("./ComposedComponent"); var _ComposedComponent2 = _interopRequireDefault(_ComposedComponent); @@ -104,6 +108,7 @@ var Select = function (_Component) { var _props = this.props, form = _props.form, + error = _props.error, getLocalizedString = _props.localization.getLocalizedString; var currentValue = this.state.currentValue; @@ -131,9 +136,10 @@ var Select = function (_Component) { ); }); } + return _react2.default.createElement( _FormControl2.default, - { fullWidth: true }, + { fullWidth: true, error: !!error }, _react2.default.createElement( _InputLabel2.default, { required: form.required }, @@ -148,6 +154,11 @@ var Select = function (_Component) { onChange: this.onSelected }, menuItems + ), + _react2.default.createElement( + _FormHelperText2.default, + null, + (error || form.description) && getLocalizedString(error || form.description) ) ); }