@@ -7,6 +7,8 @@ import Grid from '@material-ui/core/Grid';
77import MuiTextField from '@material-ui/core/TextField' ;
88import Checkbox from '@material-ui/core/Checkbox' ;
99import FormControlLabel from '@material-ui/core/FormControlLabel' ;
10+ import FormHelperText from '@material-ui/core/FormHelperText' ;
11+ import FormControl from '@material-ui/core/FormControl' ;
1012import Switch from '@material-ui/core/Switch' ;
1113import FormGroup from '@material-ui/core/FormGroup' ;
1214import MuiSelect from './select-field' ;
@@ -39,6 +41,7 @@ const selectComponent = ({
3941 offText,
4042 error,
4143 locale = 'en' ,
44+ originalLabel,
4245 ...rest
4346} ) => ( {
4447 [ componentTypes . TEXT_FIELD ] : ( ) => (
@@ -75,10 +78,20 @@ const selectComponent = ({
7578 />
7679 ) ,
7780 [ componentTypes . CHECKBOX ] : ( ) => (
78- < FormControlLabel
79- control = { < Checkbox { ...input } disabled = { isDisabled } value = { input . name } /> }
80- label = { label }
81- />
81+ < FormControl required = { isRequired } error = { invalid } component = "fieldset" >
82+ < FormGroup error = { invalid } >
83+ < FormControlLabel
84+ control = { < Checkbox
85+ { ...input }
86+ disabled = { isDisabled || isReadOnly }
87+ value = { input . name }
88+ /> }
89+ disabled = { isDisabled || isReadOnly }
90+ label = { originalLabel }
91+ />
92+ { ( invalid || helperText ) && < FormHelperText > { invalid || helperText } </ FormHelperText > }
93+ </ FormGroup >
94+ </ FormControl >
8295 ) ,
8396 [ componentTypes . RADIO ] : ( ) => (
8497 < RadioGroup
@@ -183,6 +196,7 @@ const FinalFormField = ({
183196 invalid,
184197 label : invalid ? meta . error : label ,
185198 helperText : helperText || description ,
199+ originalLabel : label ,
186200 } ) ( ) }
187201 </ Grid >
188202 ) ;
0 commit comments