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;