shithub: puzzles

Download patch

ref: 36c9062cbd01024610032e8a31b66ef12a7c11d9
parent: 271fb7f47c060bf7ebb34e3cb71fc1b47aa23723
author: Ben Harris <bjh21@bjh21.me.uk>
date: Thu Nov 24 13:26:59 EST 2022

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.

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