Skip to content

Commit c663463

Browse files
committed
fix(forms): fix number inputs to throw NaN errors when empty
1 parent e2df77b commit c663463

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/forms/helpers/useFormControl.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function getTargetValue(target) {
5555
let value = target.type === 'checkbox' ? target.checked : target.value;
5656

5757
if (target.type === 'number') {
58-
value = target.valueAsNumber;
58+
value = target.valueAsNumber || undefined;
5959
}
6060

6161
if (target.type === 'datetime-local') {

0 commit comments

Comments
 (0)