This commit is contained in:
Louis Mazin 2026-09-25 15:20:00 +02:00
parent 36463f8cbb
commit 848699ba61

View File

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