Skip to content

Commit

Permalink
fix: fix released async problem #2145
Browse files Browse the repository at this point in the history
  • Loading branch information
Rui-Sun committed Jul 31, 2024
1 parent 501bfa1 commit 1b735c4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vtable",
"comment": "fix: fix released async problem #2145",
"type": "none"
}
],
"packageName": "@visactor/vtable"
}
2 changes: 1 addition & 1 deletion packages/vtable/src/ListTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ export class ListTable extends BaseTable implements ListTableAPI {
this.render();
if (isValid(oldHoverState.col) && isValid(oldHoverState.row) && oldHoverState.col >= 0 && oldHoverState.row >= 0) {
setTimeout(() => {
this.internalProps.tooltipHandler.showTooltip(oldHoverState.col, oldHoverState.row);
this.internalProps?.tooltipHandler.showTooltip(oldHoverState.col, oldHoverState.row);
}, 0);
}
console.log('setRecords cost time:', (typeof window !== 'undefined' ? window.performance.now() : 0) - time);
Expand Down
4 changes: 4 additions & 0 deletions packages/vtable/src/event/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ export class EventManager {
}
updateEventBinder() {
setTimeout(() => {
if (this.table.isReleased) {
return;
}

// 处理textStick 是否绑定SCROLL的判断
if (checkHaveTextStick(this.table) && this.handleTextStickBindId?.length === 0) {
this.handleTextStickBindId.push(
Expand Down

0 comments on commit 1b735c4

Please sign in to comment.