From 6345d768796a6f217b40864490f05febd1cd6dcc Mon Sep 17 00:00:00 2001 From: Rui-Sun Date: Fri, 11 Oct 2024 20:38:54 +0800 Subject: [PATCH] fix: fix sort icon update in merge cell --- .../vtable/fix-merge-sort-icon_2024-10-11-12-38.json | 10 ++++++++++ packages/vtable/src/state/state.ts | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 common/changes/@visactor/vtable/fix-merge-sort-icon_2024-10-11-12-38.json diff --git a/common/changes/@visactor/vtable/fix-merge-sort-icon_2024-10-11-12-38.json b/common/changes/@visactor/vtable/fix-merge-sort-icon_2024-10-11-12-38.json new file mode 100644 index 000000000..456de9910 --- /dev/null +++ b/common/changes/@visactor/vtable/fix-merge-sort-icon_2024-10-11-12-38.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vtable", + "comment": "fix: fix sort icon update in merge cell", + "type": "none" + } + ], + "packageName": "@visactor/vtable" +} \ No newline at end of file diff --git a/packages/vtable/src/state/state.ts b/packages/vtable/src/state/state.ts index 1a3c71026..00be2059f 100644 --- a/packages/vtable/src/state/state.ts +++ b/packages/vtable/src/state/state.ts @@ -1274,7 +1274,8 @@ export class StateManager { // 执行sort dealSort(col, row, this.table as ListTableAPI, event); - const currentSortItem = this.sort.find(item => item.col === col && item.row === row); + const range = this.table.getCellRange(col, row); + const currentSortItem = this.sort.find(item => item.col === range.start.col && item.row === range.start.row); const oldSortCol = this.table.internalProps.multipleSort || !previousSortItem ? null : previousSortItem.col; const oldSortRow = this.table.internalProps.multipleSort || !previousSortItem ? null : previousSortItem.row;