From c4962601eb88ca3a51c0f7ba31cc2bd251ee9038 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 28 Apr 2023 23:33:14 +0200 Subject: Only toggle body.shift if the active element is the root. Avoid toggling shift stuff if the chat input box has focus, etc. --- public/common/play.js | 5 +++-- 1 file 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) => { -- cgit v1.2.3