Closed hmnd closed 2 years ago
Strange doesn't happen in my tests or the REPL... but looks like a valid bug.
https://svelte.dev/repl/7f0f9f3a64c04567b1ae8513383fd046?version=3.47.0
@hmnd what version of svelte are you running?
@rob-balfre ah, I'm using objects for suggestions like so: https://svelte.dev/repl/0e27b81c0c414c7c8ed1cd899fe290a7?version=3.47.0. Are they not supposed to work like that?
I'm on v3.47.0 too.
Suggestions is just an array of strings to populate 'filterText' on click. Maybe the docs aren't very clear.
Ahh ok. I was able to implement the behavior I was looking for by flipping between providing pre-loaded items
and loadOptions
depending on whether there is active filterText
. Probably better as a separate issue, but would be great if there was a preload
setting to allow loading initial options by calling loadOptions
without a search value.
Docs (and ts types) might be a little clearer if the type was explicitly string[]
instead of array
.
I've added string[]
to the docs for suggestions
. Thanks.
When selecting a suggestion,![image](https://user-images.githubusercontent.com/12853597/163092768-cdb4a204-1b22-4cf0-b721-95d05ce4959e.png)
fitlerText
seems to be reset toundefined
, causingsetupFilterText
to error, and the component to freeze. See the stacktrace below: