From 3718800a8627efbe2555ddefd45c3fc5c00107b1 Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Tue, 17 Mar 2020 17:21:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20combo=20=E5=8D=95=E9=80=89?= =?UTF-8?q?=E6=A8=A1=E5=BC=8FsyncFields=20=E6=97=A0=E6=95=88=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderers/Form/Combo.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/renderers/Form/Combo.tsx b/src/renderers/Form/Combo.tsx index 309386b42..204525b17 100644 --- a/src/renderers/Form/Combo.tsx +++ b/src/renderers/Form/Combo.tsx @@ -569,7 +569,7 @@ export default class ComboControl extends React.Component { Array.isArray(syncFields) ? JSON.stringify([value, index, data, pickVars(data, syncFields)]): strictMode ? JSON.stringify([value, index]) : JSON.stringify([value, index, data]) ); - formatValue(value: any, index: number) { + formatValue(value: any, index: number = -1) { const {flat, data, strictMode, syncFields} = this.props; if (flat) { @@ -1065,7 +1065,7 @@ export default class ComboControl extends React.Component { } = this.props; let controls = this.props.controls; - const data = isObject(value) ? value : this.defaultValue; + const data = isObject(value) ? this.formatValue(value) : this.defaultValue; let condition: Condition | null = null; if (Array.isArray(conditions) && conditions.length) { @@ -1112,7 +1112,7 @@ export default class ComboControl extends React.Component { }, { disabled: disabled, - data: isObject(value) ? value : this.defaultValue, + data: data, onChange: this.handleSingleFormChange, ref: this.makeFormRef(0), onInit: this.handleSingleFormInit,