Added default support to <EnumInput/>

This commit is contained in:
orangemug 2019-10-16 10:12:59 +01:00
parent 392a845460
commit 8c760bb810

View file

@ -29,13 +29,13 @@ class EnumInput extends React.Component {
if(options.length <= 3 && optionsLabelLength(options) <= 20) { if(options.length <= 3 && optionsLabelLength(options) <= 20) {
return <MultiButtonInput return <MultiButtonInput
options={options} options={options}
value={value} value={value || this.props.default}
onChange={onChange} onChange={onChange}
/> />
} else { } else {
return <SelectInput return <SelectInput
options={options} options={options}
value={value} value={value || this.props.default}
onChange={onChange} onChange={onChange}
/> />
} }