web/Omnibox: accept keyboard shortcuts only when focused

This commit is contained in:
wukko 2024-07-28 23:36:38 +06:00
parent 48d24ee1ea
commit a4e0e21a97
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2

View file

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