diff --git a/frontend/src/pages/CalendarPage.jsx b/frontend/src/pages/CalendarPage.jsx index 764a9ff..d92a32c 100644 --- a/frontend/src/pages/CalendarPage.jsx +++ b/frontend/src/pages/CalendarPage.jsx @@ -312,6 +312,7 @@ const CalendarPage = () => { }; }; const getOrderedSelection = () => { + if (isMobile) return null; if (!selectionStart || !selectionEnd) return null; return selectionStart <= selectionEnd ? { start: selectionStart, end: selectionEnd } @@ -333,7 +334,7 @@ const CalendarPage = () => { isSelectingRef.current = false; }; const beginSelection = (pointerEvent, date) => { - if (pointerEvent.button !== 0) return; + if (isMobile || pointerEvent.pointerType === 'touch' || pointerEvent.button !== 0) return; pointerEvent.preventDefault(); closeContextMenu(); setHoveredEvent(null); @@ -345,7 +346,7 @@ const CalendarPage = () => { setIsSelecting(true); }; const updateSelectionFromPointer = (pointerEvent) => { - if (!isSelectingRef.current) return; + if (isMobile || !isSelectingRef.current) return; const element = document.elementFromPoint( pointerEvent.clientX, pointerEvent.clientY, @@ -430,6 +431,9 @@ const CalendarPage = () => { window.removeEventListener('pointercancel', handlePointerUp); }; }, []); + useEffect(() => { + if (isMobile) clearSelection(); + }, [isMobile]); /* * ============================================================ * DIMENSIONS CALENDRIER