Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If a field is not required and typeError is specified, on not entering anything also, it gives an error(typeError) #2214

Open
vishal-gits opened this issue May 10, 2024 · 0 comments

Comments

@vishal-gits
Copy link

I am using validation for postalcode in a input box.

phone: yup
.number()
.max(9)
.typeError("Provide in postalcode number format"),

When typeError() is given to phone(which is not specified required), and when nothing is entered for phone, then also it attaches a typeError to it. Ideally if nothing is entered and it is not specified "required", it should not give an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant