From 6a7519f14099aee56d97dcd52c4998499642bbbf Mon Sep 17 00:00:00 2001 From: rickcole Date: Mon, 1 Jun 2020 16:45:58 +0800 Subject: [PATCH 1/3] =?UTF-8?q?list=E8=AE=BE=E7=BD=AEjoinValues:false?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=9B=9E=E6=98=BE=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderers/Form/List.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/renderers/Form/List.tsx b/src/renderers/Form/List.tsx index 2bc9e3ee..1cef47a4 100644 --- a/src/renderers/Form/List.tsx +++ b/src/renderers/Form/List.tsx @@ -73,7 +73,9 @@ export default class ListControl extends React.Component {
o.value === option.value + ), 'is-disabled': option.disabled || disabled })} onClick={this.handleClick.bind(this, option)} From 8fc4f69dff6e9687c79edbf6bad91053f55aaf23 Mon Sep 17 00:00:00 2001 From: rickcole Date: Wed, 3 Jun 2020 11:59:28 +0800 Subject: [PATCH 2/3] =?UTF-8?q?form=E4=B8=ADinput-group=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderers/Form/Control.tsx | 4 +++- src/renderers/Form/InputGroup.tsx | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/renderers/Form/Control.tsx b/src/renderers/Form/Control.tsx index 00923e35..63d775d6 100644 --- a/src/renderers/Form/Control.tsx +++ b/src/renderers/Form/Control.tsx @@ -522,6 +522,7 @@ export default class FormControl extends React.PureComponent< store, data, disabled, + onChange: superOnChange, ...rest } = this.props; @@ -539,7 +540,8 @@ export default class FormControl extends React.PureComponent< data: store ? store.data : data, value, formItemValue: value, // 为了兼容老版本的自定义组件 - onChange: this.handleChange, + onChange: + control.type === 'input-group' ? superOnChange : this.handleChange, onBlur: this.handleBlur, setValue: this.setValue, getValue: this.getValue, diff --git a/src/renderers/Form/InputGroup.tsx b/src/renderers/Form/InputGroup.tsx index 0163d8ec..deca7de6 100644 --- a/src/renderers/Form/InputGroup.tsx +++ b/src/renderers/Form/InputGroup.tsx @@ -50,7 +50,7 @@ export class InputGroup extends React.Component< } renderControl(control: any, index: any, otherProps?: any) { - const {render} = this.props; + const {render, onChange} = this.props; if (!control) { return null; @@ -71,6 +71,7 @@ export class InputGroup extends React.Component< } return render(`${index}`, subSchema, { + onChange, ...otherProps }); } From a3d4e361796361fe964c80c9b2dd9b51655eb504 Mon Sep 17 00:00:00 2001 From: rickcole Date: Wed, 3 Jun 2020 12:01:58 +0800 Subject: [PATCH 3/3] reveert --- src/renderers/Form/List.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/renderers/Form/List.tsx b/src/renderers/Form/List.tsx index 1cef47a4..2bc9e3ee 100644 --- a/src/renderers/Form/List.tsx +++ b/src/renderers/Form/List.tsx @@ -73,9 +73,7 @@ export default class ListControl extends React.Component {
o.value === option.value - ), + 'is-active': ~selectedOptions.indexOf(option), 'is-disabled': option.disabled || disabled })} onClick={this.handleClick.bind(this, option)}