The issue is fixed by a change in the order of handling changes reactively (first items, and then selectedItems).
This is a very small change to the control flow and only "local", because it affects only the case when simple-svelte-autocomplete is used with the items attribute and everything stay the same for the case of using searchFunction.
I can not see that this PR actually changes code besides the formatting.
Please when submitting PRs to other repos try to keep the formatting as the other code in the repo.
The issue is fixed by a change in the order of handling changes reactively (first
items
, and thenselectedItems
).This is a very small change to the control flow and only "local", because it affects only the case when simple-svelte-autocomplete is used with the
items
attribute and everything stay the same for the case of usingsearchFunction
.The fix solves problem in the minimal example, see this branch: https://github.com/nika-d/autocomplete-minimal-example/tree/fixing .