diff --git a/src/lib/components/functional/FormatDropdown.svelte b/src/lib/components/functional/FormatDropdown.svelte index 6ba572f..ca2002b 100644 --- a/src/lib/components/functional/FormatDropdown.svelte +++ b/src/lib/components/functional/FormatDropdown.svelte @@ -107,6 +107,23 @@ searchQuery = (event.target as HTMLInputElement).value; }; + const clickDropdown = () => { + open = !open; + if (open) { + setTimeout(() => { + if (dropdownMenu) { + const searchInput = dropdownMenu.querySelector( + "#format-search", + ) as HTMLInputElement; + if (searchInput) { + searchInput.focus(); + searchInput.select(); + } + } + }, 0); // let dropdown open first + } + }; + onMount(() => { const handleClickOutside = (e: MouseEvent) => { if (dropdown && !dropdown.contains(e.target as Node)) { @@ -139,10 +156,9 @@ bind:this={dropdown} >