diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-04-28 23:33:14 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-04-28 23:36:11 +0200 |
commit | c4962601eb88ca3a51c0f7ba31cc2bd251ee9038 (patch) | |
tree | 9592f9bc053b8d77753d1f06d36c2f43556a0c0c | |
parent | 1a55b0b11f1d1a0f3d3226bf37a8ac09ad3345ef (diff) | |
download | server-c4962601eb88ca3a51c0f7ba31cc2bd251ee9038.tar.gz |
Only toggle body.shift if the active element is the root.
Avoid toggling shift stuff if the chat input box has focus, etc.
-rw-r--r-- | public/common/play.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/public/common/play.js b/public/common/play.js index bb3c5ae..ba8c647 100644 --- a/public/common/play.js +++ b/public/common/play.js @@ -589,8 +589,9 @@ function zoom_map() { window.addEventListener("resize", zoom_map) window.addEventListener("keydown", (evt) => { - if (evt.key === "Shift") - document.querySelector("body").classList.add("shift") + if (document.activeElement === document.querySelector("body")) + if (evt.key === "Shift") + document.querySelector("body").classList.add("shift") }) window.addEventListener("keyup", (evt) => { |