From 4bf4b1e69b29e3958e6fc2ca48f5487a3a1eff03 Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 20 Dec 2023 23:48:28 -0600 Subject: [PATCH] don't focus input on ctrl key --- src/web/assets/script.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/web/assets/script.js b/src/web/assets/script.js index fe655d8..ec87e9f 100644 --- a/src/web/assets/script.js +++ b/src/web/assets/script.js @@ -26,7 +26,12 @@ searchInputEl.addEventListener("input", async (e) => { // if the user starts typing but they don't have focus on the input, focus it document.addEventListener("keydown", (e) => { // must be a letter or number - if (e.key.match(/^[a-z0-9]$/i) && !searchInputEl.matches(":focus")) { + if ( + e.key.match(/^[a-z0-9]$/i) && + !searchInputEl.matches(":focus") && + !e.ctrlKey && + !e.metaKey + ) { searchInputEl.focus(); } });