How to implement a multiple select? #103
-
I was working with a simple I forked the example and changed the type select field with the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I'll add an example soon! There seems to have been a regression as well and this is not working currently. I'll create an issue from this. |
Beta Was this translation helpful? Give feedback.
-
Your example should work without any changes as of Nothing prevents you from assigning a stringified JSON as value, you'd need to parse it on submission or transform it using a |
Beta Was this translation helpful? Give feedback.
Your example should work without any changes as of
@felte/[email protected]
. A slight difference from how Svelte handles it is that we take the values as the DOM would have theme in the case of<select>
elements. That means that the value you'll receive will always be a string or an array of strings in the case of<select multiple>
.Nothing prevents you from assigning a stringified JSON as value, you'd need to parse it on submission or transform it using a
transform
function.