Skip to content

Commit dbdad24

Browse files
committed
fix(ObjectControl): hotfix nested object validation
1 parent e216545 commit dbdad24

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/decap-cms-widget-object/src/ObjectControl.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,12 @@ export default class ObjectControl extends React.Component {
7979
if (field.get('widget') === 'hidden') return;
8080
const name = field.get('name');
8181
const control = this.childRefs[name];
82-
control?.validate?.();
82+
83+
if (control?.innerWrappedControl?.validate) {
84+
control.innerWrappedControl.validate();
85+
} else {
86+
control?.validate?.();
87+
}
8388
});
8489
};
8590

0 commit comments

Comments
 (0)