From dfb44214842c05833e50d1dcc7cf4ab1b2b48b15 Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Fri, 12 Jan 2024 09:50:17 +0800 Subject: [PATCH] fix: table column sort params should support cancel sort (#3372) * fix: sort params * fix: sort params --- .../core/client/src/block-provider/TableBlockProvider.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/core/client/src/block-provider/TableBlockProvider.tsx b/packages/core/client/src/block-provider/TableBlockProvider.tsx index 7829612acb..6663c512b8 100644 --- a/packages/core/client/src/block-provider/TableBlockProvider.tsx +++ b/packages/core/client/src/block-provider/TableBlockProvider.tsx @@ -174,11 +174,7 @@ export const useTableBlockProps = () => { ctx.service.refresh(); }, onChange({ current, pageSize }, filters, sorter) { - const sort = sorter.order - ? sorter.order === `ascend` - ? [sorter.field] - : [`-${sorter.field}`] - : globalSort || ctx.service.params?.[0]?.sort; + const sort = sorter.order ? (sorter.order === `ascend` ? [sorter.field] : [`-${sorter.field}`]) : globalSort; ctx.service.run({ ...ctx.service.params?.[0], page: current, pageSize, sort }); }, onClickRow(record, setSelectedRow, selectedRow) {