Skip to content

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

@seakrebel

Description

@seakrebel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions