rob-balfre / svelte-select

Svelte Select. A select component for Svelte
https://svelte-select-examples.vercel.app
Other
1.25k stars 175 forks source link

select with loadOptions : function don't fire when empty filterText #501

Closed amandineLecuyer closed 1 year ago

amandineLecuyer commented 1 year ago

Version : beta On a Select with display async options, when I type a letter then remove, loadOptions function don't fire and the options visible are items get with previous call on loadOptions. When text is empty, loadOptions should fire with filterText=''. On v4 it's work like that but not on v5.

jwlarocque commented 1 year ago

On 4.4.7 it also doesn't seem to fire with an empty input, it just clears the options without checking.
I agree that especially if a custom loadOptions is passed in, it should be fired. It would be nice if it could be called on focus as well - I'd like to show some unfiltered options even before text has been entered.

(This might be an option somewhere already, but I looked through the readme and didn't see it there.)

rob-balfre commented 1 year ago

Yeah I think loadOptions is a bit too prescriptive and inflexible, I'll have a think. Thanks