fix(web): stop Escape falling through release deck
ci / rust (pull_request) Successful in 1m41s
ci / web (pull_request) Successful in 30s

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 <noreply@anthropic.com>
This commit is contained in:
Miguel Palhas
2026-08-22 22:36:34 +01:00
co-authored by Claude Fable 5
parent e9f8694a32
commit fb7fe49d70
+12 -5
View File
@@ -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;