Skip to content

Commit 294dd53

Browse files
authored
docs: fix numeric input value when string is empty to null (#9941)
1 parent b14eaba commit 294dd53

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

documentation/docs/02-template-syntax/05-element-directives.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ If the name matches the value, you can use a shorthand.
116116
-->
117117
```
118118

119-
Numeric input values are coerced; even though `input.value` is a string as far as the DOM is concerned, Svelte will treat it as a number. If the input is empty or invalid (in the case of `type="number"`), the value is `undefined`.
119+
Numeric input values are coerced; even though `input.value` is a string as far as the DOM is concerned, Svelte will treat it as a number. If the input is empty or invalid (in the case of `type="number"`), the value is `null`.
120120

121121
```svelte
122122
<input type="number" bind:value={num} />

0 commit comments

Comments
 (0)