metonym / svelte-typeahead

Accessible, fuzzy search typeahead component
https://metonym.github.io/svelte-typeahead
MIT License
222 stars 18 forks source link

[QUESTION] Show first entries on input click #64

Closed psociety closed 1 year ago

psociety commented 1 year ago

Thank you for creating typeahead! It's really cool!

I would like to show the first entries when clicking the input, (like a select would do). It can be useful to avoid typing when the list is initially small. I tought it was showDropdownOnFocus but it doesn't show up when input is empty :O

metonym commented 1 year ago

Thanks for raising this issue.

This is supported in v4.4.0. Set showAllResultsOnFocus to true for all results to be shown when an empty input is focused.

<Typeahead showAllResultsOnFocus {data} {extract} />

Link to demo

psociety commented 1 year ago

N|Solid