Skip to content

Commit

Permalink
✨ passive event listener
Browse files Browse the repository at this point in the history
  • Loading branch information
zhzLuke96 committed May 29, 2024
1 parent 746f135 commit 437a2b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/core/src/ContextMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,10 @@ export default class ContextMenu {
}

root.addEventListener("wheel", on_mouse_wheel, true);
root.addEventListener("mousewheel", on_mouse_wheel, true);
root.addEventListener("mousewheel", on_mouse_wheel, {
capture: true,
passive: true,
});

this.root = root;

Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/LGraphCanvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,10 @@ export default class LGraphCanvas
this._mousedown_callback,
true,
); //down do not need to store the binded
canvas.addEventListener("mousewheel", this._mousewheel_callback, false);
canvas.addEventListener("mousewheel", this._mousewheel_callback, {
capture: false,
passive: false,
});

LiteGraph.pointerListenerAdd(
canvas,
Expand Down

0 comments on commit 437a2b4

Please sign in to comment.