From 536ec2e8febc1d7934fa3c8eb5f7d5dfc800a745 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 26 Oct 2023 16:39:04 +0200 Subject: Remove body.shift when window loses focus. Key-up events are not delivered when the window is blurred. --- public/common/client.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'public') diff --git a/public/common/client.js b/public/common/client.js index ef6e6df..9bbb74f 100644 --- a/public/common/client.js +++ b/public/common/client.js @@ -372,6 +372,10 @@ window.addEventListener("keyup", (evt) => { document.querySelector("body").classList.remove("shift") }) +window.addEventListener("blur", function (evt) { + document.querySelector("body").classList.remove("shift") +}) + /* REMATCH BUTTON */ function add_icon_button(where, id, img, fn) { -- cgit v1.2.3