simple-svelte-autocomplete
simple-svelte-autocomplete copied to clipboard
onChange gets triggered on parent component mount
The onChange function set up in the Autocomplete component gets triggered twice before I even do anything. How to stop that? It should only trigger once the Autocomplete input box has lost focus.
Same here. In my case, I have 2 different onChange handle functions on separate Autocomplete components. both functions are triggered when I only change the value on one of the components.
I feel like the problem is somewhere here
https://github.com/pstanoev/simple-svelte-autocomplete/blob/f9d8ada45f9ff208379f772e1df6f6dd42d6a3b5/src/SimpleAutocomplete.svelte#L333-L343
$
statements get triggered on component mount, so onSelectedItemChanged
is called, so onChange
is called
I have no clue how it could/should be solved because i don't know the source code well enough