Skip to content

Commit

Permalink
fix(BasicTable): keep rowSelection onChange call outside (#3461). res…
Browse files Browse the repository at this point in the history
…olve #3453
  • Loading branch information
xachary authored Dec 25, 2023
1 parent b57d9fc commit a7b2f14
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/Table/src/hooks/useRowSelection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ export function useRowSelection(

return {
selectedRowKeys: unref(selectedRowKeysRef),
onChange: (selectedRowKeys: Key[]) => {
onChange: (selectedRowKeys: Key[], selectedRows: any[]) => {
setSelectedRowKeys(selectedRowKeys);
// 维持外部定义的onChange回调
rowSelection.onChange?.(selectedRowKeys, selectedRows);
},
...omit(rowSelection, ['onChange']),
};
Expand Down

0 comments on commit a7b2f14

Please sign in to comment.