From 04700bc55d89e9dae7556d700332704ac4f5bb32 Mon Sep 17 00:00:00 2001 From: onlyhom Date: Fri, 26 Aug 2022 16:17:48 +0800 Subject: [PATCH] fix: ms-wheel undefined error in pc --- src/ms-core.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ms-core.ts b/src/ms-core.ts index 1e0738c..ea6d6d2 100644 --- a/src/ms-core.ts +++ b/src/ms-core.ts @@ -690,8 +690,10 @@ export default class MobileSelect { touch(event: TouchEvent | MouseEvent): void { const path = event.composedPath && event.composedPath(); const currentCol = path.find((domItem) => { - return (domItem as HTMLElement).classList.contains("ms-wheel"); + return (domItem as HTMLElement).classList?.contains("ms-wheel"); }) as HTMLElement; + if (!currentCol) return; + const theSlider = currentCol.firstChild as HTMLElement; // ul.select-container const index = parseInt(currentCol.getAttribute("data-index") || "0"); switch (event.type) {