From 20a4c76fd798cde29cf1f3b15c1bebaf69c48ef0 Mon Sep 17 00:00:00 2001 From: Keavon Chambers Date: Mon, 6 Dec 2021 02:55:05 -0800 Subject: [PATCH] Fix bug in last commit that broke when scrolling on SVG elements --- frontend/src/utilities/input.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/utilities/input.ts b/frontend/src/utilities/input.ts index 6c4a4c3a..d695146b 100644 --- a/frontend/src/utilities/input.ts +++ b/frontend/src/utilities/input.ts @@ -106,7 +106,7 @@ export async function onMouseScroll(e: WheelEvent) { const target = e.target && (e.target as HTMLElement); const inCanvas = target && target.closest(".canvas"); - const horizontalScrollableElement = e.target instanceof HTMLElement && e.target.closest(".scrollable-x"); + const horizontalScrollableElement = e.target instanceof Element && e.target.closest(".scrollable-x"); if (horizontalScrollableElement && e.deltaY !== 0) { horizontalScrollableElement.scrollTo(horizontalScrollableElement.scrollLeft + e.deltaY, 0); return;