Fix bug in last commit that broke when scrolling on SVG elements

This commit is contained in:
Keavon Chambers 2021-12-06 02:55:05 -08:00
parent 207e46ed4f
commit 20a4c76fd7
1 changed files with 1 additions and 1 deletions

View File

@ -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;