From e7d61c724f6ffb96f65db65169672c60ced4a213 Mon Sep 17 00:00:00 2001 From: Mikael A <58765940+mikaelaldy@users.noreply.github.com> Date: Mon, 1 Jun 2026 21:08:57 +0700 Subject: [PATCH] Let calendar handle Escape while open --- static/app.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/static/app.js b/static/app.js index 95159c4..bd96c4b 100644 --- a/static/app.js +++ b/static/app.js @@ -490,6 +490,15 @@ function initializeEventListeners() { return; } + // Calendar owns a few inner Escape layers (settings panel, event form, + // then the calendar modal itself). Let calendar.js handle those instead + // of falling through to unrelated page-level fallbacks like document + // panel minimize. + const calendarModal = document.getElementById('calendar-modal'); + if (calendarModal && !calendarModal.classList.contains('hidden') && getComputedStyle(calendarModal).display !== 'none') { + return; + } + // Close one modal at a time (last in DOM = topmost) // Map modal id → sidebar list-item id to clear active state const modalItemMap = {