From 47a89509818a985e58f4c88d1c5741d6b4dd214f Mon Sep 17 00:00:00 2001 From: Manuel Riezebosch Date: Wed, 7 Jun 2023 08:23:32 +0200 Subject: [PATCH] fix(graph): disable scroll on trackpad --- html/index.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/html/index.html b/html/index.html index 44a4759..ab1407c 100644 --- a/html/index.html +++ b/html/index.html @@ -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); + }; + }