Do not handle modifier hotkeys if input is not focused
This commit is contained in:
parent
7267f89377
commit
44b9597981
@ -107,6 +107,11 @@ const colorsHotkeys = {
|
|||||||
|
|
||||||
for (const hotkey in colorsHotkeys) {
|
for (const hotkey in colorsHotkeys) {
|
||||||
Mousetrap.bind("mod+" + hotkey, function(e) {
|
Mousetrap.bind("mod+" + hotkey, function(e) {
|
||||||
|
// Do not handle modifier hotkeys if input is not focused
|
||||||
|
if (document.activeElement !== input[0]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
const modifier = colorsHotkeys[e.key];
|
const modifier = colorsHotkeys[e.key];
|
||||||
|
Loading…
Reference in New Issue
Block a user