fix(editor): should not update table selection after table is destroyed (#9665)
This commit is contained in:
@@ -78,7 +78,7 @@ export class SelectGroupView extends BaseGroup<
|
|||||||
};
|
};
|
||||||
|
|
||||||
get tag() {
|
get tag() {
|
||||||
return this.data.options.find(v => v.id === this.value);
|
return this.data.options?.find(v => v.id === this.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override render(): unknown {
|
protected override render(): unknown {
|
||||||
|
|||||||
@@ -1017,6 +1017,9 @@ export class SelectionElement extends WithDisposable(ShadowlessElement) {
|
|||||||
this.disposables.add(
|
this.disposables.add(
|
||||||
effect(() => {
|
effect(() => {
|
||||||
this.startUpdate(this.selection$.value);
|
this.startUpdate(this.selection$.value);
|
||||||
|
return () => {
|
||||||
|
this.cancelSelectionUpdate();
|
||||||
|
};
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1033,11 +1036,15 @@ export class SelectionElement extends WithDisposable(ShadowlessElement) {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
startUpdate(selection?: TableViewSelection) {
|
cancelSelectionUpdate() {
|
||||||
if (this.preTask) {
|
if (this.preTask) {
|
||||||
cancelAnimationFrame(this.preTask);
|
cancelAnimationFrame(this.preTask);
|
||||||
this.preTask = 0;
|
this.preTask = 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
startUpdate(selection?: TableViewSelection) {
|
||||||
|
this.cancelSelectionUpdate();
|
||||||
if (
|
if (
|
||||||
selection?.selectionType === 'area' &&
|
selection?.selectionType === 'area' &&
|
||||||
!this.controller.host.props.view.readonly$.value
|
!this.controller.host.props.view.readonly$.value
|
||||||
|
|||||||
Reference in New Issue
Block a user