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 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
e9f8694a32
commit
fb7fe49d70
+12
-5
@@ -799,11 +799,18 @@ function releasesMain(): ReleasesView {
|
|||||||
|
|
||||||
back.addEventListener("click", close);
|
back.addEventListener("click", close);
|
||||||
|
|
||||||
window.addEventListener("keydown", (event) => {
|
// capture + stopPropagation: one Escape steps back one layer, instead
|
||||||
if (event.key === "Escape" && !view.hidden) {
|
// of falling through to the search deck's own Escape handler
|
||||||
close();
|
window.addEventListener(
|
||||||
}
|
"keydown",
|
||||||
});
|
(event) => {
|
||||||
|
if (event.key === "Escape" && !view.hidden) {
|
||||||
|
event.stopPropagation();
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
true,
|
||||||
|
);
|
||||||
|
|
||||||
sweep.addEventListener("click", () => {
|
sweep.addEventListener("click", () => {
|
||||||
const movie = current;
|
const movie = current;
|
||||||
|
|||||||
Reference in New Issue
Block a user