pstanoev / simple-svelte-autocomplete

Simple Autocomplete / typeahead component for Svelte
http://simple-svelte-autocomplete.surge.sh/
MIT License
468 stars 79 forks source link

Fixed minCharactersToSearch behavior with async #161

Closed azmeuk closed 2 years ago

azmeuk commented 2 years ago

Currently, when the input is focused, the behavior is different if a searchFunction is defined or not. When not defined, the menu always open, independently of minCharactersToSearch, when defined, the menu nevers opens, independently of minCharactersToSearch.

This patch does not change behavior when searchFunction is not defined, but when it is and minCharactersToSearch is 0, then the menu opens when the input is focused.

I am not sure this is what we want though, I think behavior probably should not be different wether searchFunction is defined or not.

What do you think?

pstanoev commented 2 years ago

We should look again at this. IMO, the behavior should be different if searchFunction is defined or not. If it is not, always open. If searchFuncton is defined, open only if minCharactersToSearch=0.

We have also #172 which mentions this issue.