Skip to content

Commit

Permalink
fix: Make some event listeners explicitly passive (#856)
Browse files Browse the repository at this point in the history
  • Loading branch information
jespertheend authored Jan 7, 2024
1 parent 0fd75b8 commit 3d8f138
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/util/OrbitControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class OrbitControls {
*/
addEventElement(elem) {
this._addedEventElements.push(elem);
elem.addEventListener("wheel", this._boundOnWheel);
elem.addEventListener("wheel", this._boundOnWheel, {passive: false});
elem.addEventListener("pointerdown", this._boundOnPointerDown);
}

Expand Down
2 changes: 1 addition & 1 deletion studio/src/ui/NumericGui.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export class NumericGui {
this.el.addEventListener("focus", this.boundOnFocus);
this.el.addEventListener("blur", this.boundOnBlur);
this.el.addEventListener("mousedown", this.boundOnMouseDown);
this.el.addEventListener("wheel", this.boundOnWheel);
this.el.addEventListener("wheel", this.boundOnWheel, {passive: false});
this.el.addEventListener("input", this.#onInput);

const studio = getMaybeStudioInstance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,6 @@ export class ContentWindowEntityEditor extends ContentWindow {
// We only want to save the orbit state when a project entity is loaded.
// Otherwise, empty projects will be marked as worth saving even though nothing was changed.
if (this.isEditingProjectEntity) {
console.log(this.orbitControls.lookRot);
this.#setOrbitPreference("entityEditor.orbitLookPos", this.orbitControls.lookPos.toArray());
this.#setOrbitPreference("entityEditor.orbitLookRot", this.orbitControls.lookRot.toArray());

Expand Down

0 comments on commit 3d8f138

Please sign in to comment.