From 0e676184a946b950303f3964e7770abecfab8033 Mon Sep 17 00:00:00 2001 From: Theo Cavignac Date: Fri, 23 Dec 2022 00:00:54 +0100 Subject: [PATCH] Fix a bug due to non standard attribute. --- js/ToolManager.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/ToolManager.js b/js/ToolManager.js index caa6a53..2228611 100644 --- a/js/ToolManager.js +++ b/js/ToolManager.js @@ -47,8 +47,9 @@ const ToolManager = (() => { if (!EditorState.documentCreated || Dialogue.isOpen()) return; - const isHoveringMenuElement = !!mouseEvent.path.find(n=>n.id && n.id.includes("-menu")); - if(isHoveringMenuElement)return; + // Hovering a menu element + const path = mouseEvent.composedPath && mouseEvent.composedPath(); + if (path && !!path.find(n=>n.id && n.id.includes("-menu"))) return; let mousePos = Input.getCursorPosition(mouseEvent); tools["zoom"].onMouseWheel(mousePos, mouseEvent.deltaY < 0 ? 'in' : 'out'); @@ -164,4 +165,4 @@ const ToolManager = (() => { return { currentTool } -})(); \ No newline at end of file +})();