Skip to content

Commit

Permalink
Merge pull request #2951 from VisActor/2948-refactor-columnwidthconfig
Browse files Browse the repository at this point in the history
2948 refactor columnwidthconfig
  • Loading branch information
fangsmile authored Nov 28, 2024
2 parents 5a10926 + 82b7810 commit 3254a8a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "refactor: when columnWidthConfig set wrong dimensions should judge this case #2948\n\n",
"type": "none",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "[email protected]"
}
11 changes: 8 additions & 3 deletions packages/vtable/src/PivotTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1112,9 +1112,14 @@ export class PivotTable extends BaseTable implements PivotTableAPI {
const dimensions = item.dimensions;
const width = item.width;
const cell = this.getCellAddressByHeaderPaths(dimensions);
if (cell && !this.internalProps._widthResizedColMap.has(cell.col)) {
this._setColWidth(cell.col, width);
this.internalProps._widthResizedColMap.add(cell.col); // add resize tag
if (cell.col >= this.rowHeaderLevelCount) {
const cellPath = this.getCellHeaderPaths(cell.col, this.columnHeaderLevelCount - 1);
if (cellPath.colHeaderPaths.length === dimensions.length) {
if (cell && !this.internalProps._widthResizedColMap.has(cell.col)) {
this._setColWidth(cell.col, width);
this.internalProps._widthResizedColMap.add(cell.col); // add resize tag
}
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/vtable/src/event/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ export class EventManager {
eventArgs.event.shiftKey,
eventArgs.event.ctrlKey || eventArgs.event.metaKey,
false,
this.table.options.select?.makeSelectCellVisible ?? true
isSelectMoving ? false : this.table.options.select?.makeSelectCellVisible ?? true
);

return true;
Expand Down

0 comments on commit 3254a8a

Please sign in to comment.