Skip to content

Commit

Permalink
Merge pull request #471 from richardsolomou/master
Browse files Browse the repository at this point in the history
Fix removeEventListener error (PixiJS 7)
  • Loading branch information
davidfig committed May 5, 2024
2 parents 0d3ea55 + a28c7d0 commit 2b60d87
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/InputManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class InputManager
*/
public destroy(): void
{
this.viewport.options.events.domElement.removeEventListener('wheel', this.wheelFunction as any);
this.viewport.options.events.domElement?.removeEventListener('wheel', this.wheelFunction as any);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Viewport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export class Viewport extends Container
}
if (this.options.disableOnContextMenu)
{
this.options.events.domElement.removeEventListener('contextmenu', this._disableOnContextMenu);
this.options.events.domElement?.removeEventListener('contextmenu', this._disableOnContextMenu);
}

this.input.destroy();
Expand Down

0 comments on commit 2b60d87

Please sign in to comment.