Closed Prinzhorn closed 2 years ago
Also hitting the X will then set the value to undefined. But it should set it to an empty array. An empty array is the empty state for a multi-selection.
undefined
https://svelte.dev/repl/f2f816f630fc463b83c66324af9596f3?version=3.42.3
<script> import AutoComplete from "simple-svelte-autocomplete"; const colors = ["White", "Red", "Yellow", "Green", "Blue", "Black"]; let selectedColors = []; </script> <AutoComplete items={colors} bind:selectedItem={selectedColors} multiple /> <div>Selected colors: <code>{JSON.stringify(selectedColors)}</code></div>
https://user-images.githubusercontent.com/679144/131130168-284be41a-3cb0-4137-a2f0-0a6a531581a3.mp4
Fixed.
Also hitting the X will then set the value to
undefined
. But it should set it to an empty array. An empty array is the empty state for a multi-selection.https://svelte.dev/repl/f2f816f630fc463b83c66324af9596f3?version=3.42.3
https://user-images.githubusercontent.com/679144/131130168-284be41a-3cb0-4137-a2f0-0a6a531581a3.mp4