diff --git a/src/renderers/Form/SubForm.tsx b/src/renderers/Form/SubForm.tsx index 1877f5ff6..6870b2a1b 100644 --- a/src/renderers/Form/SubForm.tsx +++ b/src/renderers/Form/SubForm.tsx @@ -179,15 +179,17 @@ export default class SubFormControl extends React.PureComponent - {(value && labelField && value[labelField] && stripTag(value[labelField])) - || render('label', - { - type: 'tpl', - tpl: btnLabel - }, - { - data - })} + {(value && labelField && value[labelField] && stripTag(value[labelField])) || + render( + 'label', + { + type: 'tpl', + tpl: btnLabel + }, + { + data + } + )} )) @@ -225,16 +227,17 @@ export default class SubFormControl extends React.PureComponent - {(value && labelField && value[labelField] && stripTag(value[labelField])) - || render('label', - { - type: 'tpl', - tpl: btnLabel - }, - { - data - } - )}} + {(value && labelField && value[labelField] && stripTag(value[labelField])) || + render( + 'label', + { + type: 'tpl', + tpl: btnLabel + }, + { + data + } + )} @@ -248,16 +251,12 @@ export default class SubFormControl extends React.PureComponent {multiple ? this.renderMultipe() : this.renderSingle()} - {openedIndex !== -1 - ? render(`dalog/${openedIndex}`, this.buildDialogSchema(), { - onClose: this.close, - onConfirm: this.handleDialogConfirm, - data: createObject( - data, - (multiple ? Array.isArray(value) && value[openedIndex] : value) || {} - ) - }) - : null} + {render(`dalog/${openedIndex}`, this.buildDialogSchema(), { + show: openedIndex !== -1, + onClose: this.close, + onConfirm: this.handleDialogConfirm, + data: createObject(data, (multiple ? Array.isArray(value) && value[openedIndex] : value) || {}) + })} ); }