form icon indicating copy to clipboard operation
form copied to clipboard

Problem with getting field errors at validateFieldsInternal method

Open alex-knyazev opened this issue 5 years ago • 1 comments

https://github.com/react-component/form/blob/master/src/createBaseForm.js#L547

If we have array as a field value - we have an array in fieldErrors variables here, not an object with errors property.

But string below expects errors property in fieldErrors : https://github.com/react-component/form/blob/master/src/createBaseForm.js#L555

I also created related issue un antd-design:

https://github.com/ant-design/ant-design/issues/20878

Reproduction, where we can see the behaviour I've described

https://github.com/alex-knyazev/antd-validation-bug-reproduction

alex-knyazev avatar Jan 13 '20 22:01 alex-knyazev

P.S.: I found solution only with using of async-validator lib and custom validator prop:

https://github.com/alex-knyazev/antd-validation-bug-reproduction/commit/f61be6fe316668c647769a1e89c2b2e26c4fbdd9

alex-knyazev avatar Jan 14 '20 06:01 alex-knyazev