Provide type-safe value
s to <option />
when the parent <select />
has its value bound by a typed variable.
#2298
Labels
feature request
New feature or request
Describe the problem
The following component
should not have any errors. If I were type out the possible values however, the following gives an error, as it should:
But so should this (putting an
<option />
element with an illegal value:Describe the proposed solution
It would be nice is the svelte compiler would be able to warn you when the
bind
directive is used with a value and its type is not respected in this case.The following are the edge-cases I identified where there could be type checking:
value
attribute is "correct" based on the type of the parent's bound variable should be done.Importance
nice to have
The text was updated successfully, but these errors were encountered: