-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
I have a yup object with a custom validation (test) which relies on the entire object. As validation is only triggered on changing fields, this test is never ran. It would be good if there was a way to trigger validation on the entire form/nested form. (e.g. add the validateOn/noValidate props to Form/NestedForm).
For now I have done this as a work around (code is copied from NestedForm and modified so it will run the validation on it):
const [, meta] = useField(name);
return (
<Form
as="div"
schema={schema}
value={meta.value}
onChange={meta.onChange}
onError={(nextErrors) => meta.onError(prefix(nextErrors, name))}
errors={unprefix(meta.errors, name)}
context={meta.context}
>Thanks!
Metadata
Metadata
Assignees
Labels
No labels