From d2f143133e06d1f90a6f77acded931ba36a04b86 Mon Sep 17 00:00:00 2001 From: Antonio De Lucreziis Date: Mon, 27 Feb 2023 00:29:23 +0100 Subject: [PATCH] fix: no hover on mobile --- src/components/view/Course.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/view/Course.jsx b/src/components/view/Course.jsx index 42f3727..e29c29e 100644 --- a/src/components/view/Course.jsx +++ b/src/components/view/Course.jsx @@ -21,8 +21,10 @@ export const Course = ({ events, selection, setSelection, hideOtherCourses }) => useEffect(() => { if (element.current) { const l = e => { + const isMobile = window.matchMedia('(pointer: coarse)').matches + const $course = e.target.closest('.course') - if ($course) { + if ($course && !isMobile) { setCurrentlyHovered($course.dataset.courseId) } else { setCurrentlyHovered(null)