Do not handle modifier hotkeys if input is not focused

This commit is contained in:
Pavel Djundik 2018-03-13 10:31:52 +02:00
parent 7267f89377
commit 44b9597981

View File

@ -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];