We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<Autocomplete bind:highlightedItem={hItem} ... />
When you highlight first item in list, hItem is set to null.
hItem
null
It's because highlightIndex is 0 in this expression:
highlightIndex
$: highlightedItem = filteredListItems && highlightIndex && highlightIndex >= 0 && highlightIndex < filteredListItems.length ? filteredListItems[highlightIndex].item : null;
I suggest this patch:
diff --git a/src/SimpleAutocomplete.svelte b/src/SimpleAutocomplete.svelte index 3b27caf..e7275a6 100644 --- a/src/SimpleAutocomplete.svelte +++ b/src/SimpleAutocomplete.svelte @@ -344,7 +344,7 @@ $: highlightedItem = filteredListItems && - highlightIndex && + highlightIndex !== undefined && highlightIndex >= 0 && highlightIndex < filteredListItems.length ? filteredListItems[highlightIndex].item
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When you highlight first item in list,
hItem
is set tonull
.It's because
highlightIndex
is 0 in this expression:I suggest this patch:
The text was updated successfully, but these errors were encountered: