Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2948 refactor columnwidthconfig #2951

Merged
merged 5 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]"
}
8 changes: 5 additions & 3 deletions packages/vtable/src/PivotTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1112,9 +1112,11 @@ 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.row >= this.columnHeaderLevelCount - 1) {
if (cell && !this.internalProps._widthResizedColMap.has(cell.col)) {
this._setColWidth(cell.col, width);
this.internalProps._widthResizedColMap.add(cell.col); // add resize tag
}
}
}
}
Expand Down
Loading