Merge branch 'master' into localdev

This commit is contained in:
Keyan 2024-03-07 15:24:41 -06:00 committed by GitHub
commit 265f92af35
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -450,7 +450,9 @@ function InputInner ({
if (draft) {
// for some reason we have to turn off validation to get formik to
// not assume this is invalid
helpers.setValue(draft, false)
const isNumeric = /^[0-9]+$/.test(draft)
const numericExpected = typeof field.value === 'number'
helpers.setValue(isNumeric && numericExpected ? parseInt(draft) : draft, false)
onChange && onChange(formik, { target: { value: draft } })
}
}