fix(widget-list): validate string values in list widget (#2385)

This commit is contained in:
Bartholomew 2019-06-24 23:50:26 +01:00 committed by Shawn Erquhart
parent e6f24d47ec
commit 814aa5091b

View File

@ -18,7 +18,9 @@ export default class ControlPane extends React.Component {
if (!wrappedControl) return;
const name = field.get('name');
const widget = field.get('widget');
if (widget === 'list' || widget === 'object') {
const listFields = field => field.get('field') || field.get('fields') || field.get('types');
if ((widget === 'list' && listFields(field)) || widget === 'object') {
this.componentValidate[name] = wrappedControl.innerWrappedControl.validate;
} else {
this.componentValidate[name] = wrappedControl.validate;