From 0b762cf89f81eb1ba479e284afcddd142b449665 Mon Sep 17 00:00:00 2001 From: Katherine Date: Sat, 2 Nov 2024 19:19:54 +0800 Subject: [PATCH] fix: issue with adding data to sub-table after deletion (#5566) --- .../src/schema-component/antd/table-v2/Table.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/table-v2/Table.tsx b/packages/core/client/src/schema-component/antd/table-v2/Table.tsx index cebde23d27..bbde2d43c7 100644 --- a/packages/core/client/src/schema-component/antd/table-v2/Table.tsx +++ b/packages/core/client/src/schema-component/antd/table-v2/Table.tsx @@ -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); }); }} />