Skip to content
Merged
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
8 changes: 6 additions & 2 deletions pxtblocks/fields/field_animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,12 @@ export class FieldAnimationEditor extends FieldAssetEditor<FieldAnimationOptions

onDispose() {
super.onDispose();
(this.sourceBlock_ as Blockly.BlockSvg).getSvgRoot().removeEventListener("mouseenter", this.onMouseEnter);
(this.sourceBlock_ as Blockly.BlockSvg).getSvgRoot().removeEventListener("mouseleave", this.cancelAnimation);

const root = (this.sourceBlock_ as Blockly.BlockSvg)?.getSvgRoot();
if (root) {
root.removeEventListener("mouseenter", this.onMouseEnter);
root.removeEventListener("mouseleave", this.cancelAnimation);
}
document.removeEventListener("mousemove", this.onDocumentMouseMove);
}
}
Expand Down
Loading