This commit is contained in:
Philipp Dormann 2025-05-20 00:59:01 +02:00
parent 50b5e4e455
commit 286bd61497
Signed by: philipp
GPG Key ID: 3BB9ADD52DCA4314
2 changed files with 9 additions and 1 deletions

View File

@ -218,7 +218,8 @@
return option.label.toLowerCase().startsWith(searchTerm.toLowerCase()); return option.label.toLowerCase().startsWith(searchTerm.toLowerCase());
}} }}
bind:selected={selectedOption} bind:selected={selectedOption}
placeholder="Search fruits..." inputPlaceholder={$_("search-for-runner-by-name-or-id")}
noOptionsText={$_("no-runners-found")}
on:select={handleSelect} on:select={handleSelect}
/> />
{#if selectedOption} {#if selectedOption}

View File

@ -105,6 +105,12 @@
await updateVisibleCount(); // Ensure items render on focus await updateVisibleCount(); // Ensure items render on focus
} }
// Handle input typing to open dropdown
async function handleInput() {
isOpen = true;
await updateVisibleCount(); // Ensure items render on typing
}
// Handle keyboard navigation // Handle keyboard navigation
function handleKeydown(event, index) { function handleKeydown(event, index) {
if (!isOpen) return; if (!isOpen) return;
@ -185,6 +191,7 @@
? 'text-black' ? 'text-black'
: 'text-gray-700'}" : 'text-gray-700'}"
on:focus={handleInputFocus} on:focus={handleInputFocus}
on:input={handleInput}
on:keydown={(e) => { on:keydown={(e) => {
if (e.key === "Enter" && !isOpen) { if (e.key === "Enter" && !isOpen) {
toggleDropdown(); toggleDropdown();