From 44b959798121b19f80256ab9e1d615183dacbaa2 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Tue, 13 Mar 2018 10:31:52 +0200 Subject: [PATCH] Do not handle modifier hotkeys if input is not focused --- client/js/keybinds.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/js/keybinds.js b/client/js/keybinds.js index f702e341..1ed82db8 100644 --- a/client/js/keybinds.js +++ b/client/js/keybinds.js @@ -107,6 +107,11 @@ const colorsHotkeys = { for (const hotkey in colorsHotkeys) { Mousetrap.bind("mod+" + hotkey, function(e) { + // Do not handle modifier hotkeys if input is not focused + if (document.activeElement !== input[0]) { + return; + } + e.preventDefault(); const modifier = colorsHotkeys[e.key];