From 0fd3b14106df15ef99b0f6d4bf830cfe595e7c5c Mon Sep 17 00:00:00 2001 From: RUNZE LU <36724300+lurunze1226@users.noreply.github.com> Date: Wed, 10 Aug 2022 20:17:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20InputTable=E7=BB=84=E4=BB=B6needConfirm?= =?UTF-8?q?=E4=B8=BAtrue=E6=97=B6=E6=97=A0=E6=B3=95=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E8=A1=8C=E9=97=AE=E9=A2=98=20(#5108)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/amis/src/renderers/Form/InputTable.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/amis/src/renderers/Form/InputTable.tsx b/packages/amis/src/renderers/Form/InputTable.tsx index c8cc3163b..7d2ed7e77 100644 --- a/packages/amis/src/renderers/Form/InputTable.tsx +++ b/packages/amis/src/renderers/Form/InputTable.tsx @@ -1092,10 +1092,12 @@ export default class FormTable extends React.Component { */ @autobind handlePristineChange(data: Record, rowIndex: string) { + const {needConfirm} = this.props; + const index = Number(rowIndex); + this.setState( prevState => { const items = cloneDeep(prevState.items); - const index = Number(rowIndex); if ( Number.isInteger(index) && @@ -1109,7 +1111,11 @@ export default class FormTable extends React.Component { return null; }, () => { - this.emitValue(); + if (needConfirm === false) { + this.emitValue(); + } else { + Number.isInteger(index) && this.startEdit(index, true); + } } ); }