diff --git a/src/routes/Forms/TableForm.js b/src/routes/Forms/TableForm.js index 4e5142cc86822164207f4297f09aceda3ab47622..51929c343cb02aa5fb51d509ffe86b4b93bc048f 100644 --- a/src/routes/Forms/TableForm.js +++ b/src/routes/Forms/TableForm.js @@ -102,10 +102,10 @@ export default class TableForm extends PureComponent { }); return; } - const { data } = this.state; - const { onChange } = this.props; delete target.isNew; this.toggleEditable(e, key); + const { data } = this.state; + const { onChange } = this.props; onChange(data); this.setState({ loading: false, @@ -121,9 +121,9 @@ export default class TableForm extends PureComponent { const target = this.getRowByKey(key, newData); if (this.cacheOriginData[key]) { Object.assign(target, this.cacheOriginData[key]); - target.editable = false; delete this.cacheOriginData[key]; } + target.editable = false; this.setState({ data: newData }); this.clickedCancel = false; }