mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 02:48:55 +08:00
fix: InputTable组件needConfirm为true时无法新增行问题 (#5108)
This commit is contained in:
parent
7f4689b993
commit
0fd3b14106
@ -1092,10 +1092,12 @@ export default class FormTable extends React.Component<TableProps, TableState> {
|
||||
*/
|
||||
@autobind
|
||||
handlePristineChange(data: Record<string, any>, 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<TableProps, TableState> {
|
||||
return null;
|
||||
},
|
||||
() => {
|
||||
this.emitValue();
|
||||
if (needConfirm === false) {
|
||||
this.emitValue();
|
||||
} else {
|
||||
Number.isInteger(index) && this.startEdit(index, true);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user