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
I'm not sure if this is a documentation issue or an actual bug, since the code explicitly defaults to null for invalid inputs.
function to_number(value) {
return value === '' ? null : +value;
}
my understanding of the code: it should return null for empty input and NaN for invalid inputs.
the docs mention: it should return undefined for empty and invalid inputs.
the actual behaviour: returns undefined for empty inputs but null for invalid inputs.
it's so confusing :)
7nik
linked a pull request
Apr 25, 2025
that will
close
this issue
Describe the bug
https://svelte.dev/docs/svelte/bind#input-bind:value
the docs here say it is undefined in the case of an empty or a invalid input. but is null in the case of an invalid input.
Reproduction
https://svelte.dev/playground/064fcdbe349a4ee2887a12ee696b5730?version=5.28.1
Logs
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: