Skip to content

Commit

Permalink
fix(Autocomplete): allow on:change to be used
Browse files Browse the repository at this point in the history
  • Loading branch information
N00nDay committed Sep 25, 2023
1 parent 3f481a1 commit 53e2e1f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/components/autocomplete/Autocomplete.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
inputMobile.value = '';
}
input.value = '';
input.dispatchEvent(new Event('change', { bubbles: true }));
value = undefined;
$selectedOption = undefined;
visible = false;
Expand All @@ -64,12 +65,14 @@
function handleSelect(option: string) {
value = option;
input.value = option;
input.dispatchEvent(new Event('change', { bubbles: true }));
$selectedOption = option;
visible = false;
}
function handleClear() {
input.value = '';
input.dispatchEvent(new Event('change', { bubbles: true }));
value = undefined;
$selectedOption = undefined;
}
Expand Down

0 comments on commit 53e2e1f

Please sign in to comment.