From 37a163f3f101ccd3221fd34e06f685e0e230003f Mon Sep 17 00:00:00 2001 From: xzdry Date: Mon, 13 Jun 2022 09:56:33 +0800 Subject: [PATCH] fix(Table): fix the problem that selectedRow has no value --- packages/arco-lib/src/components/Table/Table.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/arco-lib/src/components/Table/Table.tsx b/packages/arco-lib/src/components/Table/Table.tsx index 4940b295..3e24fb27 100644 --- a/packages/arco-lib/src/components/Table/Table.tsx +++ b/packages/arco-lib/src/components/Table/Table.tsx @@ -487,6 +487,16 @@ export const Table = implementRuntimeComponent({ checkCrossPage: checkCrossPage, // This option is required to achieve multi-selection across pages when customizing paging preserveSelectedRowKeys: useCustomPagination ? checkCrossPage : undefined, + onSelect: (selected, record) => { + mergeState({ + selectedRow: selected ? record : undefined, + }); + }, + onSelectAll: () => { + mergeState({ + selectedRow: undefined, + }); + }, onChange(selectedRowKeys, selectedRows) { mergeState({ selectedRowKeys: selectedRowKeys as string[],