diff --git a/src/lib/components/functional/FormatDropdown.svelte b/src/lib/components/functional/FormatDropdown.svelte index 21815d2..94a2935 100644 --- a/src/lib/components/functional/FormatDropdown.svelte +++ b/src/lib/components/functional/FormatDropdown.svelte @@ -216,6 +216,23 @@ } }; + 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)) { @@ -248,10 +265,9 @@ bind:this={dropdown} >