From fb7fe49d70179f19fee88b7a9c1f6d53e582fc6c Mon Sep 17 00:00:00 2001 From: Miguel Palhas Date: Sat, 22 Aug 2026 22:36:34 +0100 Subject: [PATCH] fix(web): stop Escape falling through release deck Both the release deck and the search deck listen for Escape on window; closing the deck unhid the search results, and the same event then hit the search handler and jumped to the board. Capture-phase handler with stopPropagation makes one press step back exactly one layer. Co-Authored-By: Claude Fable 5 --- web/src/main.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/web/src/main.ts b/web/src/main.ts index c07a18f..1db5cff 100644 --- a/web/src/main.ts +++ b/web/src/main.ts @@ -799,11 +799,18 @@ function releasesMain(): ReleasesView { back.addEventListener("click", close); - window.addEventListener("keydown", (event) => { - if (event.key === "Escape" && !view.hidden) { - close(); - } - }); + // capture + stopPropagation: one Escape steps back one layer, instead + // of falling through to the search deck's own Escape handler + window.addEventListener( + "keydown", + (event) => { + if (event.key === "Escape" && !view.hidden) { + event.stopPropagation(); + close(); + } + }, + true, + ); sweep.addEventListener("click", () => { const movie = current;