We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b38a5e6 commit 179a539Copy full SHA for 179a539
components/form.js
@@ -450,7 +450,9 @@ function InputInner ({
450
if (draft) {
451
// for some reason we have to turn off validation to get formik to
452
// not assume this is invalid
453
- helpers.setValue(draft, false)
+ const isNumeric = /^[0-9]+$/.test(draft)
454
+ const numericExpected = typeof field.value === 'number'
455
+ helpers.setValue(isNumeric && numericExpected ? parseInt(draft) : draft, false)
456
onChange && onChange(formik, { target: { value: draft } })
457
}
458
0 commit comments