diff --git a/src/components/CalendarView.vue b/src/components/CalendarView.vue index 1f84273..1efb5a4 100644 --- a/src/components/CalendarView.vue +++ b/src/components/CalendarView.vue @@ -51,6 +51,19 @@ const selection = ref({ startDate: null, dayCount: 0 }) const isDragging = ref(false) const dragAnchor = ref(null) +// Rebuild visible weeks whenever selection changes so day.isSelected stays in sync. +watch( + () => [selection.value.startDate, selection.value.dayCount], + () => { + // Skip if no selection (both null/0) to avoid unnecessary work. + if (!selection.value.startDate || selection.value.dayCount === 0) { + scheduleRebuild('selection-clear') + } else { + scheduleRebuild('selection') + } + }, +) + const DOUBLE_TAP_DELAY = 300 const pendingTap = ref({ date: null, time: 0, type: null }) const suppressMouseUntil = ref(0)