feat(webui): start upload on Enter press

feat/tables
Tomáš Mládek 2024-02-06 09:45:13 +01:00
parent 53135d4a9e
commit c246b267d1
1 changed files with 12 additions and 1 deletions

View File

@ -73,9 +73,20 @@
progress = {};
}
}
function onKeydown(event: KeyboardEvent) {
if (!files.length) return;
if (event.key === 'Enter') {
event.preventDefault();
upload();
}
if (event.key === 'Escape') {
reset();
}
}
</script>
<svelte:body on:keydown={(ev) => ev.key === 'Escape' && reset()} />
<svelte:body on:keydown={onKeydown} />
<!-- svelte-ignore a11y-click-events-have-key-events a11y-no-static-element-interactions -->
<div class="addmodal-container" class:visible class:uploading on:click={reset}>