Ignore path specifiers if root node is given

This commit is contained in:
Valentin Boettcher 2019-04-04 12:31:10 +02:00
parent e763eba370
commit 1ab07269d2

View file

@ -490,12 +490,15 @@ class SmartForm extends Component {
field.nestedSchema = fieldSchema.schema;
field.nestedInput = true;
// get all children by path (if any)
const children = this.getChildFields(fieldName);
// get nested schema
// for each nested field, get field object by calling createField recursively
field.nestedFields = this.getFieldNames({
schema: field.nestedSchema,
fields: this.getChildFields(fieldName) || '*'
}).map(subFieldName => {
fields: (this.props.fields.includes(fieldName) || !children) ? '*' : children
}).map(subFieldName => {
return this.createField(
subFieldName,
field.nestedSchema,