diff --git a/wren-ui/src/components/table/MultiSelectBox.tsx b/wren-ui/src/components/table/MultiSelectBox.tsx index 1bb0739fc..b2397bd7d 100644 --- a/wren-ui/src/components/table/MultiSelectBox.tsx +++ b/wren-ui/src/components/table/MultiSelectBox.tsx @@ -104,11 +104,15 @@ export default function MultiSelectBox(props: Props) { if (keys.length !== 1) { if (keys.length === 0) { setSelectedRowKeys(new Set()); + onChange && onChange([]); return; } - setSelectedRowKeys( - new Set([...selectedRowKeys, ...(keys as string[])]), - ); + const newSelectedRowKeys = [ + ...selectedRowKeys, + ...(keys as string[]), + ]; + setSelectedRowKeys(new Set(newSelectedRowKeys)); + onChange && onChange(newSelectedRowKeys); } }, }}