Skip to content

Commit

Permalink
fix: document event listener potentially not unregistered (#4509)
Browse files Browse the repository at this point in the history
Co-authored-by: Hugo Newman <hugo.newman@aize.io>
Co-authored-by: Christopher J. Tannum <christopher.tannum@cognite.com>
  • Loading branch information
3 people authored May 21, 2024
1 parent 5480f6b commit e7a707d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions viewer/packages/camera-manager/src/DefaultCameraManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ export class DefaultCameraManager implements CameraManager {
}
this.keyboardNavigationEnabled = keyboardNavigationEnabled;
this._domElement.removeEventListener('pointerdown', stopTween);
document.removeEventListener('keydown', stopTween);
})
.start(TWEEN.now());
tween.update(TWEEN.now());
Expand Down Expand Up @@ -411,6 +412,7 @@ export class DefaultCameraManager implements CameraManager {
this.setComboControlsOptions({ lookAtViewTarget: false });
this.keyboardNavigationEnabled = keyboardNavigationEnabled;
this._domElement.removeEventListener('pointerdown', stopTween);
document.removeEventListener('keydown', stopTween);
})
.start(TWEEN.now());
tween.update(TWEEN.now());
Expand Down

0 comments on commit e7a707d

Please sign in to comment.