wip
This commit is contained in:
parent
50b5e4e455
commit
286bd61497
@ -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}
|
||||||
|
@ -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();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user