jannikbuschke / formik-antd

Simple declarative bindings for Ant Design and Formik.

Home Page:https://codesandbox.io/s/github/jannikbuschke/formik-antd-example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

select multiple validation errors not shown

linchen2chris opened this issue · comments

I have a field which is an array, with initial value [], I will validate it by Yup.array().required('required'), but its touched is false when submit, and validation error can not shown.

fix this and create a PR for this, waiting for merge #166

will close after PR merged

I faced up with the same issue. Sometimes error is shown, but it hides after submitting form
Yup.array().of(Yup.string()).min(1, 'Error text')

@MaruniakS actually the error is there, but array field has some problem with touched, it will hide the error

@MaruniakS yeap, instead of setting touched to true for multi-select, it sets touched to an empty array on form submit validation.

#166 fixed it