fix: issue with adding data to sub-table after deletion (#5566)

This commit is contained in:
Katherine 2024-11-02 19:19:54 +08:00 committed by GitHub
parent 582f1d7ef8
commit 0b762cf89f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -191,12 +191,10 @@ const useTableColumns = (props: { showDel?: any; isSubTable?: boolean }, paginat
onClick={() => {
return action(() => {
const fieldIndex = (current - 1) * pageSize + index;
spliceArrayState(field, {
startIndex: fieldIndex,
deleteCount: 1,
});
field.value.splice(fieldIndex, 1);
return field.onInput(field.value);
const updatedValue = [...field.value];
updatedValue.splice(fieldIndex, 1);
field.value = updatedValue;
field.onInput(field.value);
});
}}
/>