diff --git a/components/calendar/calendar-day-view.tsx b/components/calendar/calendar-day-view.tsx index 62e0d554..3dd516d9 100644 --- a/components/calendar/calendar-day-view.tsx +++ b/components/calendar/calendar-day-view.tsx @@ -119,6 +119,7 @@ export function CalendarDayView({ created: t("notifications.event_created"), error: t("notifications.event_error"), }, + isMobile, }); const formatHour = (h: number): string => { diff --git a/components/calendar/calendar-week-view.tsx b/components/calendar/calendar-week-view.tsx index 19aa3d8e..369e5fe4 100644 --- a/components/calendar/calendar-week-view.tsx +++ b/components/calendar/calendar-week-view.tsx @@ -183,6 +183,7 @@ export function CalendarWeekView({ created: t("notifications.event_created"), error: t("notifications.event_error"), }, + isMobile, }); const formatHour = (h: number): string => { diff --git a/hooks/use-time-grid-interactions.ts b/hooks/use-time-grid-interactions.ts index 675628cc..5b5e1355 100644 --- a/hooks/use-time-grid-interactions.ts +++ b/hooks/use-time-grid-interactions.ts @@ -40,6 +40,7 @@ interface UseTimeGridInteractionsOptions { created: string; error: string; }; + isMobile?: boolean; } export function useTimeGridInteractions({ @@ -47,6 +48,7 @@ export function useTimeGridInteractions({ calendars, onCreateRange, errorMessages, + isMobile, }: UseTimeGridInteractionsOptions) { const snapToMinutes = useCallback((clientY: number, containerTop: number): number => { const raw = ((clientY - containerTop) / hourHeight) * 60; @@ -72,6 +74,7 @@ export function useTimeGridInteractions({ dayKey: string, dayDate: Date, ) => { + if (isMobile) return; if (e.button !== 0) return; if ((e.target as HTMLElement).closest("[data-calendar-event], [data-resize-handle]")) return; @@ -82,7 +85,7 @@ export function useTimeGridInteractions({ dayKey, dayDate, startMinutes: minutes, pointerId: e.pointerId, startY: e.clientY, captured: false, }; - }, [snapToMinutes]); + }, [snapToMinutes, isMobile]); const handleGridPointerMove = useCallback((e: PointerEvent) => { if (!dragRef.current) return;