svelte-typeahead icon indicating copy to clipboard operation
svelte-typeahead copied to clipboard

on:change is not triggered with option showAllResultsOnFocus

Open Artofaj opened this issue 1 year ago • 1 comments

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.

Artofaj avatar Oct 23 '23 11:10 Artofaj

Aparently 'every other time' is after clicking the delete button. Only then, the next input triggers the on:change.

Artofaj avatar Oct 24 '23 07:10 Artofaj