I've identified a couple sequences of events that cause error messages to disappear when at least 2 fields are conditionally required, such as the ones described by the following schema and <Field>s:
const requiredStringWhenFirstHasValue = yup.string()
.when('first', {
is: val => val && val.length,
then: yup.string().required(),
otherwise: yup.string(),
});
const validationSchema = yup.object({
first: yup.string(),
middle: requiredStringWhenFirstHasValue,
last: requiredStringWhenFirstHasValue,
});
I've identified a couple sequences of events that cause error messages to disappear when at least 2 fields are conditionally required, such as the ones described by the following schema and
<Field>
s:I can get this to happen with or without
alsoValidates
on thefirst
field.With
alsoValidates
Without
alsoValidates
This sandbox demonstrates the symptoms with repro steps:
Any ideas?