Skip to content

Commit dd4656c

Browse files
authored
revert: logic for calculating column width before restoration
1 parent e2b4a05 commit dd4656c

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

packages/vtable/src/event/listener/table-group.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1147,9 +1147,14 @@ export function endResizeCol(table: BaseTableAPI) {
11471147
// textStick 依赖了这个事件 所以一定要触发RESIZE_COLUMN_END
11481148
// if ((table as any).hasListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN_END)) {
11491149
// RESIZE_COLUMN_END事件触发,返回所有列宽
1150+
const columns = [];
1151+
// 返回所有列宽信息
1152+
for (let col = 0; col < table.colCount; col++) {
1153+
columns.push(table.getColWidth(col));
1154+
}
11501155
table.fireListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN_END, {
11511156
col: table.stateManager.columnResize.col,
1152-
colWidths: table.getColsWidths()
1157+
colWidths: columns
11531158
});
11541159
// }
11551160
}

packages/vtable/src/event/self-event-listener/base-table/dbclick-auto-column-width.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,14 @@ export function bindDBClickAutoColumnWidthEvent(table: BaseTableAPI) {
3939
state.columnResize.isRightFrozen
4040
);
4141
}
42-
42+
const colWidths = [];
43+
// 返回所有列宽信息
44+
for (let col = 0; col < table.colCount; col++) {
45+
colWidths.push(table.getColWidth(col));
46+
}
4347
table.fireListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN_END, {
4448
col: resizeCol.col,
45-
colWidths: table.getColsWidths()
49+
colWidths
4650
});
4751
}
4852
}

0 commit comments

Comments
 (0)