diff --git a/.changeset/brown-jokes-act.md b/.changeset/brown-jokes-act.md new file mode 100644 index 000000000..67ee8eb03 --- /dev/null +++ b/.changeset/brown-jokes-act.md @@ -0,0 +1,5 @@ +--- +'formik': patch +--- + +Prevent calling getSelectedValues when the element has not options diff --git a/packages/formik/src/Formik.tsx b/packages/formik/src/Formik.tsx index 5c4ef7ee5..02934fa90 100755 --- a/packages/formik/src/Formik.tsx +++ b/packages/formik/src/Formik.tsx @@ -632,7 +632,7 @@ export function useFormik({ ? ((parsed = parseFloat(value)), isNaN(parsed) ? '' : parsed) : /checkbox/.test(type) // checkboxes ? getValueForCheckbox(getIn(state.values, field!), checked, value) - : !!multiple // ? getSelectedValues(options) : value; }