fix: cleanup nested widget validation (#2991)

* fix: cleanup nested widget validation

* fix: list input widget validation
This commit is contained in:
Bartholomew
2019-12-25 09:48:47 +01:00
committed by Erez Rokah
parent 95ba0f5cd0
commit e4ba4d9d74
3 changed files with 16 additions and 14 deletions

View File

@ -79,6 +79,7 @@ export default class ListControl extends React.Component {
onChange: PropTypes.func.isRequired,
onChangeObject: PropTypes.func.isRequired,
onValidateObject: PropTypes.func.isRequired,
validate: PropTypes.func.isRequired,
value: ImmutablePropTypes.list,
field: PropTypes.object,
forID: PropTypes.string,
@ -230,9 +231,13 @@ export default class ListControl extends React.Component {
};
validate = () => {
this.validations.forEach(validateListItem => {
validateListItem();
});
if (this.getValueType()) {
this.validations.forEach(validateListItem => {
validateListItem();
});
} else {
this.props.validate();
}
};
/**