js: Disable menu keyboard controls when dialogue box is active

I think this is broadly the wrong approach, but it's an improvement
until I implement the right one.
This commit is contained in:
Ben Harris
2022-11-24 18:26:59 +00:00
parent 271fb7f47c
commit 36c9062cbd

View File

@ -458,6 +458,8 @@ function initPuzzle() {
var cs = window.getComputedStyle(menu); var cs = window.getComputedStyle(menu);
return cs.display == "flex" && cs.flexDirection == "row"; return cs.display == "flex" && cs.flexDirection == "row";
} }
if (dlg_dimmer !== null)
return;
if (!["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Enter", if (!["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Enter",
"Escape", "Backspace", "SoftRight"] "Escape", "Backspace", "SoftRight"]
.includes(event.key)) .includes(event.key))