Closed Desteel closed 1 year ago
can you provide a codesandbox please?
Thank you for reporting this issue.
for now you can use this workaround to make it work until I fix it:
const weekValidator = ({ field, form }) => {
const hasAnswer = Object.keys(field.value).length;
console.log('week hasAnswer ', hasAnswer);
if (!hasAnswer) form.invalidate(); // <---
return [hasAnswer, 'Error message: the week is empty, but form can submit'];
};
Thank you!
:tada: This issue has been resolved in version 5.10.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
@Desteel updated sandbox: https://codesandbox.io/s/mobx-react-form-issue-519-forked-e29qi9 now should work as expected
Note: retrieveOnlyEnabledFields
has been renamed to retrieveOnlyEnabledFieldsValues
in next releases.
:tada: This issue has been resolved in version 5.10.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Hello. I use structure
And i need validate
mainField
. I set validation formainField
, i gethasError
astrue
and error message, but form can submit andform.errors
not display that errors. And if i useField.invalidate()
, i also gethasError
astrue
and error message, but form can submit.I also tested this with your example from docs