Skip to content

best way to save what you love

web/Omnibox: accept keyboard shortcuts only when focused

wukkoa4e0e21a976e
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 = "";
}