Select bind value can be of any type #1065
Replies: 1 comment 1 reply
-
I understand the appeal of this, however, if we wanted it to be type safe, it would introduce the cost to everyone of having to explicitly pass a typed array of objects with the type of value being inferred. Having the type be The primitives exist for you to easily create your own wrappers to tailor to different needs. So for example, if you consistently find yourself needing a Another one of the reasons behind it being a string is that is what the value of the select actually is in the browser, when submitted with forms or otherwise. |
Beta Was this translation helpful? Give feedback.
-
Describe the feature in detail (code, mocks, or screenshots encouraged)
A value binding corresponds to the value property on the selected , which can be any value (not just strings, as is normally the case in the DOM). I think we should reuse this option of Svelte. I have a lot boilerplate for data manipulation number->string->number What type of pull request would this be? Enhancement Provide relevant links or additional information. https://svelte.dev/docs/svelte/bind#select-bind:value
Beta Was this translation helpful? Give feedback.
All reactions