Skip to content

armgit / VERT

Public Imported from GitHub
0

The next-generation file converter. Open source, fully local* and free forever.

feat: enter to select first format

JovannMCdee3a0bf3b9d
diff --git a/src/lib/components/functional/FormatDropdown.svelte b/src/lib/components/functional/FormatDropdown.svelte
index 94a2935..f73a5df 100644
--- a/src/lib/components/functional/FormatDropdown.svelte
+++ b/src/lib/components/functional/FormatDropdown.svelte
@@ -233,6 +233,15 @@
}
};
+ const onEnter = (event: KeyboardEvent) => {
+ if (event.key === "Enter") {
+ event.preventDefault();
+ if (filteredData.formats.length > 0) {
+ selectOption(filteredData.formats[0]);
+ }
+ }
+ };
+
onMount(() => {
const handleClickOutside = (e: MouseEvent) => {
if (dropdown && !dropdown.contains(e.target as Node)) {
@@ -326,6 +335,7 @@
class="flex-grow w-full !pl-11 !pr-3 rounded-lg bg-panel text-foreground"
bind:value={searchQuery}
oninput={handleSearch}
+ onkeydown={onEnter}
onfocus={() => {}}
id="format-search"
autocomplete="off"