Skip to content

Commit

Permalink
fix(simple-form-iterator): Fixes object-object when there is a single…
Browse files Browse the repository at this point in the history
… TextInput without source param.

marmelab#2489
  • Loading branch information
gvillo committed Jan 16, 2020
1 parent 0872558 commit e68c043
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/ra-ui-materialui/src/form/SimpleFormIterator.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,14 @@ export class SimpleFormIterator extends Component {
};

addField = () => {
const { fields } = this.props;
const { fields, children } = this.props;
this.ids.push(this.nextId++);
fields.push({});
// Checks if there is just 1 children without source param then push string since it's not an {}
if (children.props && children.props.source === undefined) {
fields.push('');
} else {
fields.push({});
}
};

render() {
Expand Down

0 comments on commit e68c043

Please sign in to comment.