You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I guess this is more of a question. How would you correctly access an error message that has been set on the 'top-level' yup object, you set validationSchema to?
Let's say you write the following schema: yup.object().shape({ finished: yup.array().of(yup.string()), personal_remarks: yup.string(), person_name: yup.string() }).test('at least one field', 'Cannot submit empty', (value) => { return !!(value.finished.length || value.personal_remarks) });
The focus is on the last 'test' function on the yup object. When you set validationSchema in createForm function to the above schema, it seems to work: svelte-forms-lib prevents you from submitting. But: the error message is put in $errors.undefined, which seems odd...
Is this because $errors should only contain errors from the values in 'initialValues'? Or how would you solve this issue in svelte-forms-lib?
Thanks in advance
The text was updated successfully, but these errors were encountered:
Good afternoon
I guess this is more of a question. How would you correctly access an error message that has been set on the 'top-level' yup object, you set validationSchema to?
Let's say you write the following schema:
yup.object().shape({
finished: yup.array().of(yup.string()),
personal_remarks: yup.string(),
person_name: yup.string()
}).test('at least one field', 'Cannot submit empty', (value) => {
return !!(value.finished.length || value.personal_remarks)
});
The focus is on the last 'test' function on the yup object. When you set validationSchema in createForm function to the above schema, it seems to work: svelte-forms-lib prevents you from submitting. But: the error message is put in $errors.undefined, which seems odd...
Is this because $errors should only contain errors from the values in 'initialValues'? Or how would you solve this issue in svelte-forms-lib?
Thanks in advance
The text was updated successfully, but these errors were encountered: