svelte-typeahead
svelte-typeahead copied to clipboard
on:change is not triggered with option showAllResultsOnFocus
The component works as expected when used like this:
<Typeahead
label="Country"
hideLabel
limit={10}
placeholder="Search Country"
extract={(item) => item.NAME_0}
data={regions0}
bind:value={countrySelected}
on:change={() => {
console.log('expect an output')}
>
With this I get the output expect an output
However, if I add the showAllResultsOnFocus like this:
<Typeahead
label="Country"
hideLabel
limit={10}
placeholder="Search Country"
extract={(item) => item.NAME_0}
data={regions0}
bind:value={countrySelected}
on:change={() => {
console.log('expect an output')}
showAllResultsOnFocus
>
I just get the expected output every other time.
Aparently 'every other time' is after clicking the delete button. Only then, the next input triggers the on:change.