Skip to content

Commit

Permalink
fix(graph): disable scroll on trackpad
Browse files Browse the repository at this point in the history
  • Loading branch information
riezebosch committed Jun 7, 2023
1 parent a8b6413 commit 47a8950
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,13 @@
network.setOptions(options);
});

const { interactionHandler } = network;
if (interactionHandler) {
interactionHandler.body.eventListeners.onMouseWheel = (event) => {
if (!event.ctrlKey) return; // ctrlKey detects a mac touchpad pinch in onwheel event
interactionHandler.onMouseWheel(event);
};
}
</script>
</body>

Expand Down

0 comments on commit 47a8950

Please sign in to comment.