Skip to content

Commit

Permalink
fix: ms-wheel undefined error in pc
Browse files Browse the repository at this point in the history
  • Loading branch information
onlyhom committed Aug 26, 2022
1 parent e105bf3 commit 04700bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ms-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 04700bc

Please sign in to comment.