fix: fix sort icon update in merge cell

This commit is contained in:
Rui-Sun 2024-10-11 20:38:54 +08:00
parent ebceb5ee50
commit 6345d76879
2 changed files with 12 additions and 1 deletions

View File

@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vtable",
"comment": "fix: fix sort icon update in merge cell",
"type": "none"
}
],
"packageName": "@visactor/vtable"
}

View File

@ -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;