You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a limitation of the type system. Even if we were to be able to make it related to the input type better, it would be any at best, because it's impossible to type that for type=number the value type is different than for type=text
@dummdidumm got it, but this leaves me wondering if it is a good idea than to transform values for number input to numbers behind the scenes. In my case I wasn't expecting this at all and discovered the issue after looking at a strange runtime crashes
Describe the bug
It seems like Svelte is using type inference for binds which ends up with incorrect typings.
In practice for
<input type="number" />
the values are of typenumber | null
, but it showsstring
in the following example.This ends up with runtime errors down the road.
Reproduction
REPL
Logs
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: