There is a unintended (I guess) behaviour when you press enter AFTER you have selected an item from the list with enter key.
To recreate the issue go to demo page http://simple-svelte-autocomplete.surge.sh/?# and use the first example called "matching keyword strategy" from "advanced usage" tab.
On that example there is an array of animals:
const animals = [
"White Rabbit" --> array[0]
"White Horse" --> array[1]
"Black Rabbit" --> array[2]
"Black Horse" --> array[3]
"Black Black Rabbit" --> array[4]
]
On the autocomplete input field please type "bl" and three items will show on the filtered list array which are:
"Black Rabbit" --> array[0]
"Black Horse" --> array[1]
"Black Black Rabbit" --> array[2]
Use down arrow key to select "Black Horse". The filtered list will close and black horse will stay as value on the input field. Now if you press enter AGAIN the value will change to "White Horse".
I think this behaviour is unintended. For some reason the index [1] of "Black Horse" on the filtered list gets stored and then persists on the second "enter" but this time it selects the index from the whole items list, which in the animals array is "White Horse".
I guess after the first enter event there must be some kind of reseting on the first selected value or another solution could be to prevent the second enter happening on an empty field. Pressing enter for second time with minCharactersToSearch=1 or higher wont prevent this from happening either.
I hope my description helps to fix this, I love the multiple words searching function of this component!!
There is a unintended (I guess) behaviour when you press enter AFTER you have selected an item from the list with enter key. To recreate the issue go to demo page http://simple-svelte-autocomplete.surge.sh/?# and use the first example called "matching keyword strategy" from "advanced usage" tab.
On that example there is an array of animals:
const animals = [
On the autocomplete input field please type "bl" and three items will show on the filtered list array which are:
Use down arrow key to select "Black Horse". The filtered list will close and black horse will stay as value on the input field. Now if you press enter AGAIN the value will change to "White Horse".
I think this behaviour is unintended. For some reason the index [1] of "Black Horse" on the filtered list gets stored and then persists on the second "enter" but this time it selects the index from the whole items list, which in the animals array is "White Horse".
I guess after the first enter event there must be some kind of reseting on the first selected value or another solution could be to prevent the second enter happening on an empty field. Pressing enter for second time with minCharactersToSearch=1 or higher wont prevent this from happening either.
I hope my description helps to fix this, I love the multiple words searching function of this component!!