From 2ff4e08c4efc4d58519654c16c46b79bdbf79dae Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Mon, 25 Aug 2025 11:07:23 -0600 Subject: [PATCH] Make a repaint to show selection changes --- src/components/CalendarView.vue | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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)