diff --git a/js/app.js b/js/app.js index 578ebc7..92bea24 100644 --- a/js/app.js +++ b/js/app.js @@ -7923,11 +7923,18 @@ async function init() { e.preventDefault(); openCheatsheet(); } else if (e.key === 'Escape') { - // Close in priority order: confirm first (most modal-y) then others + // Close in priority order: confirm first (most modal-y), then the + // palette — it OPENS OVER the info modals (Ctrl+K on top of the + // cheatsheet), so it must close before them. ONE surface per + // keystroke, topmost first. if (!$('#confirmModal').classList.contains('is-hidden')) { closeConfirm(false); return; } + if (!$('#cmdPalette').classList.contains('is-hidden')) { + closePalette(); + return; + } if (!$('#changeMasterModal').classList.contains('is-hidden')) { closeChangeMasterModal(); return; @@ -7940,13 +7947,6 @@ async function init() { closeHistoryModal(); return; } - // ONE surface per keystroke, topmost first — closing several at - // once meant "Esc closes the palette AND pops the editor's - // discard prompt" (same class as the quick-search Esc bug). - if (!$('#cmdPalette').classList.contains('is-hidden')) { - closePalette(); - return; - } if (!$('#entryModal').classList.contains('is-hidden')) { closeEntryModal(); return;