From 504dfdb995094478ab83f29915e1d24861caafaa Mon Sep 17 00:00:00 2001 From: wukko Date: Tue, 16 Jul 2024 22:11:57 +0600 Subject: [PATCH] web/Omnibox: ignore keyboard shortcuts when processing --- web/src/components/save/Omnibox.svelte | 6 ++++-- web/src/components/save/buttons/DownloadButton.svelte | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/web/src/components/save/Omnibox.svelte b/web/src/components/save/Omnibox.svelte index 63d68fa9..3cd09beb 100644 --- a/web/src/components/save/Omnibox.svelte +++ b/web/src/components/save/Omnibox.svelte @@ -28,6 +28,8 @@ let linkInput: HTMLInputElement | undefined; let isFocused = false; + let isDisabled: boolean = false; + let downloadButton: SvelteComponent; const validLink = (link: string) => { @@ -67,7 +69,7 @@ }; const handleKeydown = (e: KeyboardEvent) => { - if (!linkInput || $dialogs.length > 0) { + if (!linkInput || $dialogs.length > 0 || isDisabled) { return; } @@ -136,7 +138,7 @@ (link = "")} /> {/if} {#if validLink(link)} - + {/if} diff --git a/web/src/components/save/buttons/DownloadButton.svelte b/web/src/components/save/buttons/DownloadButton.svelte index 5201b3bc..c6a37969 100644 --- a/web/src/components/save/buttons/DownloadButton.svelte +++ b/web/src/components/save/buttons/DownloadButton.svelte @@ -10,6 +10,7 @@ import type { DialogInfo } from "$lib/types/dialog"; export let url: string; + export let isDisabled = false; $: buttonText = ">>"; $: buttonAltText = $t('a11y.save.download');