svelte-forms-lib icon indicating copy to clipboard operation
svelte-forms-lib copied to clipboard

Issue with order of validation errors when using yup validation

Open seakrebel opened this issue 3 years ago • 0 comments

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 avatar Mar 19 '22 15:03 seakrebel