修复 Table quickEdit 内联模式修改完失去焦点问题

This commit is contained in:
liaoxuezhi 2019-07-11 20:29:51 +08:00
parent 4c5d60ae0a
commit 01bc463e2a

View File

@ -73,7 +73,7 @@ export default class FormTable extends React.Component<TableProps, TableState> {
];
entries:Map<any, number>;
entityId: number = 0;
entityId: number = 1;
subForms:any = {};
constructor(props:TableProps) {
super(props);
@ -513,12 +513,16 @@ export default class FormTable extends React.Component<TableProps, TableState> {
newValue.splice(rowIndex, 0, data);
});
} else {
const idx = rowIndexes as number;
const origin = newValue[idx];
const data = {
...newValue.splice(rowIndexes as number, 1)[0],
...newValue.splice(idx, 1)[0],
...diff
};
newValue.splice(rowIndexes as number, 0, data);
this.entries.set(data, this.entries.get(origin) || this.entityId++);
this.entries.delete(origin);
}
onChange(newValue);