diff --git a/src/core/components/layout-utils.jsx b/src/core/components/layout-utils.jsx index f80e0c90..00a4a09d 100644 --- a/src/core/components/layout-utils.jsx +++ b/src/core/components/layout-utils.jsx @@ -129,8 +129,7 @@ export class Select extends React.Component { value: PropTypes.any, onChange: PropTypes.func, multiple: PropTypes.bool, - allowEmptyValue: PropTypes.bool, - className: PropTypes.string + allowEmptyValue: PropTypes.bool } static defaultProps = { @@ -143,7 +142,7 @@ export class Select extends React.Component { let value - if (props.value) { + if (props.value !== undefined) { value = props.value } else { value = props.multiple ? [""] : "" @@ -179,7 +178,7 @@ export class Select extends React.Component { let value = this.state.value.toJS ? this.state.value.toJS() : this.state.value return ( - { allowEmptyValue ? : null } { allowedValues.map(function (item, key) { diff --git a/src/core/json-schema-components.js b/src/core/json-schema-components.js index 338bd6e3..bf4ae514 100644 --- a/src/core/json-schema-components.js +++ b/src/core/json-schema-components.js @@ -57,8 +57,7 @@ export class JsonSchema_string extends Component { if ( enumValue ) { const Select = getComponent("Select") - return () } + let errors = schema.errors || [] + return (
- { !value || value.count() < 1 ? null : + { !value || value.count() < 1 ? + (errors.length ? { errors[0] } : null) : value.map( (item,i) => { let schema = Object.assign({}, itemSchema) if ( errors.length ) { @@ -153,12 +153,12 @@ export class JsonSchema_array extends PureComponent { return (
this.onItemChange(val, i)} schema={schema} /> - +
) }).toArray() } - +
) } @@ -170,14 +170,12 @@ export class JsonSchema_boolean extends Component { onEnumChange = (val) => this.props.onChange(val) render() { - let { getComponent, value, schema } = this.props - let errors = schema.errors || [] + let { getComponent, required, value } = this.props const Select = getComponent("Select") - return (