metonym / svelte-typeahead

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

How to set initial value? #46

Closed Gildedter closed 2 years ago

Gildedter commented 2 years ago

If I want to pass in a key and have that be the selected one from my data as an initial value, then upon edit I just erase it, is it possible with this component?

metonym commented 2 years ago

You can set an initial value using the value prop which will be used to search and display any matching results.

<Typeahead value="initial value" {data} {extract} />
Gildedter commented 2 years ago

it sometimes shows the dropdown result, I'm ignoring it for now,