Skip to content

Commit

Permalink
fix: autocomplete can set text to a non-string value
Browse files Browse the repository at this point in the history
  • Loading branch information
hperrin committed Apr 29, 2023
1 parent f30c3de commit b4f9fa7
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/autocomplete/src/Autocomplete.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,10 @@
}
let previousValue = value;
$: if (!combobox && previousValue !== value) {
$: if (previousValue !== value) {
// If the value changes from outside, update the text.
text = getOptionLabel(value);
previousValue = value;
} else if (combobox && previousValue !== value) {
// An update came from the outside.
text = value;
previousValue = value;
} else if (combobox && value !== text) {
// An update came from the user.
value = text;
Expand Down

0 comments on commit b4f9fa7

Please sign in to comment.