From 548aa05001fa6ea0c55ad3abb1c2426a7d795b6f Mon Sep 17 00:00:00 2001 From: Victor Seiji Hariki Date: Wed, 7 Dec 2022 19:22:25 -0300 Subject: [PATCH] windows now stop wheel event propagation no more of the "mouse cursor size change while scrolling" issue Signed-off-by: Victor Seiji Hariki --- js/initalize/ui.populate.js | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/js/initalize/ui.populate.js b/js/initalize/ui.populate.js index eed8070..ba8b43c 100644 --- a/js/initalize/ui.populate.js +++ b/js/initalize/ui.populate.js @@ -1,6 +1,28 @@ -document.querySelectorAll(".floating-window").forEach((w) => { - makeDraggable(w); -}); +document.querySelectorAll(".floating-window").forEach( + /** + * Runs for each floating window + * + * @param {HTMLDivElement} w + */ + (w) => { + makeDraggable(w); + w.addEventListener( + "wheel", + (e) => { + e.stopPropagation(); + }, + {passive: false} + ); + + w.addEventListener( + "click", + (e) => { + e.stopPropagation(); + }, + {passive: false} + ); + } +); var coll = document.getElementsByClassName("collapsible"); for (var i = 0; i < coll.length; i++) {