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

Issue with order of validation errors when using yup validation #160

Open
seakrebel opened this issue Mar 19, 2022 · 0 comments
Open

Issue with order of validation errors when using yup validation #160

seakrebel opened this issue Mar 19, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@seakrebel
Copy link

seakrebel commented Mar 19, 2022

Summary

In usage with yup input validator there is a different error being shown when editing the input field, compared to when submitting the form.

Steps to reproduce

Set up an input field with multiple field requirements using yup schema

Example Project

https://codesandbox.io/s/xenodochial-sound-o6vqtf?file=/App.svelte

What is the current bug behavior?

A different error being shown when editing input field compared to when submitting the form.

What is the expected correct behavior?

I think it would be correct that the order of specified requirements for an input field also represents order of errors being thrown.
{handleChange} apparently already has a correct behavior.

Relevant logs and/or screenshots

Correct behavior with {handleChange}
brave_LN9Oq6iiFD

Wrong behavior with {handleSubmit}
brave_snheHgf2T2

Possible fixes

#161

@seakrebel seakrebel added the bug Something isn't working label Mar 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant