From a4e0e21a976e85347e688d7c14068239a7f0fc05 Mon Sep 17 00:00:00 2001 From: wukko Date: Sun, 28 Jul 2024 23:36:38 +0600 Subject: [PATCH] web/Omnibox: accept keyboard shortcuts only when focused --- web/src/components/save/Omnibox.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/components/save/Omnibox.svelte b/web/src/components/save/Omnibox.svelte index 01772358..80d89aba 100644 --- a/web/src/components/save/Omnibox.svelte +++ b/web/src/components/save/Omnibox.svelte @@ -83,11 +83,11 @@ linkInput.focus(); } - if (e.key === "Enter" && validLink($link)) { + if (e.key === "Enter" && validLink($link) && isFocused) { downloadButton.download($link); } - if (["Escape", "Clear"].includes(e.key)) { + if (["Escape", "Clear"].includes(e.key) && isFocused) { $link = ""; }