mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-01 10:58:29 +00:00
web/Omnibox: ignore keyboard shortcuts when processing
This commit is contained in:
parent
d31090c3d5
commit
504dfdb995
@ -28,6 +28,8 @@
|
|||||||
let linkInput: HTMLInputElement | undefined;
|
let linkInput: HTMLInputElement | undefined;
|
||||||
let isFocused = false;
|
let isFocused = false;
|
||||||
|
|
||||||
|
let isDisabled: boolean = false;
|
||||||
|
|
||||||
let downloadButton: SvelteComponent;
|
let downloadButton: SvelteComponent;
|
||||||
|
|
||||||
const validLink = (link: string) => {
|
const validLink = (link: string) => {
|
||||||
@ -67,7 +69,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleKeydown = (e: KeyboardEvent) => {
|
const handleKeydown = (e: KeyboardEvent) => {
|
||||||
if (!linkInput || $dialogs.length > 0) {
|
if (!linkInput || $dialogs.length > 0 || isDisabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,7 +138,7 @@
|
|||||||
<ClearButton click={() => (link = "")} />
|
<ClearButton click={() => (link = "")} />
|
||||||
{/if}
|
{/if}
|
||||||
{#if validLink(link)}
|
{#if validLink(link)}
|
||||||
<DownloadButton url={link} bind:this={downloadButton} />
|
<DownloadButton url={link} bind:this={downloadButton} bind:isDisabled={isDisabled} />
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
import type { DialogInfo } from "$lib/types/dialog";
|
import type { DialogInfo } from "$lib/types/dialog";
|
||||||
|
|
||||||
export let url: string;
|
export let url: string;
|
||||||
|
export let isDisabled = false;
|
||||||
|
|
||||||
$: buttonText = ">>";
|
$: buttonText = ">>";
|
||||||
$: buttonAltText = $t('a11y.save.download');
|
$: buttonAltText = $t('a11y.save.download');
|
||||||
|
Loading…
Reference in New Issue
Block a user