Skip to content
Open
Show file tree
Hide file tree
Changes from all 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": "fix: clear resize column/row indicator line when setRecords or updateOption is called during resizing #4120",
"type": "patch",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "2779428708@qq.com"
}
9 changes: 9 additions & 0 deletions packages/vtable/src/ListTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1547,6 +1547,15 @@ export class ListTable extends BaseTable implements ListTableAPI {
*/
setRecords(records: Array<any>, option?: { sortState?: SortState | SortState[] | null }): void {
clearChartRenderQueue();
// 如果正在进行列宽/行高调整,先清理指示线,避免残留
if (this.stateManager.isResizeCol()) {
this.scenegraph.component.hideResizeCol();
this.stateManager.columnResize.resizing = false;
}
if (this.stateManager.isResizeRow()) {
this.scenegraph.component.hideResizeRow();
this.stateManager.rowResize.resizing = false;
}
// 释放事件 及 对象
this.internalProps.dataSource?.release();
// 过滤掉dataSource的引用
Expand Down
9 changes: 9 additions & 0 deletions packages/vtable/src/PivotChart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1623,6 +1623,15 @@ export class PivotChart extends BaseTable implements PivotChartAPI {
* @param sort
*/
setRecords(records: Array<any>): void {
// 如果正在进行列宽/行高调整,先清理指示线,避免残留
if (this.stateManager.isResizeCol()) {
this.scenegraph.component.hideResizeCol();
this.stateManager.columnResize.resizing = false;
}
if (this.stateManager.isResizeRow()) {
this.scenegraph.component.hideResizeRow();
this.stateManager.rowResize.resizing = false;
}
this.internalProps.layoutMap.release();
clearChartRenderQueue();
this.scenegraph.updateChartState(null, undefined);
Expand Down
9 changes: 9 additions & 0 deletions packages/vtable/src/PivotTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1666,6 +1666,15 @@ export class PivotTable extends BaseTable implements PivotTableAPI {
*/
setRecords(records: Array<any>): void {
clearChartRenderQueue();
// 如果正在进行列宽/行高调整,先清理指示线,避免残留
if (this.stateManager.isResizeCol()) {
this.scenegraph.component.hideResizeCol();
this.stateManager.columnResize.resizing = false;
}
if (this.stateManager.isResizeRow()) {
this.scenegraph.component.hideResizeRow();
this.stateManager.rowResize.resizing = false;
}
const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
this.options.records = this.internalProps.records = records;
this.internalProps.recordsIsTwoDimensionalArray = false;
Expand Down
8 changes: 8 additions & 0 deletions packages/vtable/src/state/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,14 @@ export class StateManager {
this.setFrozenState();
}
_updateOptionSetState() {
// 如果正在进行列宽/行高调整,先隐藏指示线,避免状态重置后指示线残留
if (this.columnResize.resizing) {
this.table.scenegraph.component.hideResizeCol();
}
if (this.rowResize.resizing) {
this.table.scenegraph.component.hideResizeRow();
}

this.interactionState = InteractionState.default;
// this.select = {
// highlightScope: HighlightScope.single,
Expand Down
Loading