From 4daf1f6975f9051dd729dc47a699ec8df3836b48 Mon Sep 17 00:00:00 2001 From: "Janus C. H. Knudsen" Date: Thu, 25 Sep 2025 18:17:37 +0200 Subject: [PATCH] Calculates all-day event container height correctly Improves the calculation of the all-day event container's height by finding the highest row number in use, ensuring the container accurately reflects the space occupied by events. Updates debug logging for clarity. --- src/managers/AllDayManager.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/managers/AllDayManager.ts b/src/managers/AllDayManager.ts index 0d5d533..a813cb8 100644 --- a/src/managers/AllDayManager.ts +++ b/src/managers/AllDayManager.ts @@ -178,20 +178,20 @@ export class AllDayManager { let maxRows = 0; if (allDayEvents.length > 0) { - // Track which rows are actually used by checking grid positions - const usedRows = new Set(); + // Find the HIGHEST row number in use (not count of unique rows) + let highestRow = 0; (Array.from(allDayEvents) as HTMLElement[]).forEach((event: HTMLElement) => { const gridRow = parseInt(getComputedStyle(event).gridRowStart) || 1; - usedRows.add(gridRow); + highestRow = Math.max(highestRow, gridRow); }); - // Max rows = highest row number in use - maxRows = usedRows.size > 0 ? Math.max(...usedRows) : 0; + // Max rows = highest row number (e.g. if row 3 is used, height = 3 rows) + maxRows = highestRow; - console.log('🔍 AllDayManager: Height calculation', { + console.log('🔍 AllDayManager: Height calculation FIXED', { totalEvents: allDayEvents.length, - usedRows: Array.from(usedRows).sort(), + highestRowFound: highestRow, maxRows }); }