Skip to content

Incorrect behaviour of showErrors #157

@alexey-anufriev

Description

@alexey-anufriev

Describe the bug

When I use showErrors for custom error messages, then fields where showErrors was applied are being marked as invalid but not with a provided message, but with a generic preconfigured rule.

For example, I put a certain text into required field, then inside onSuccess I check what comes from backend and use showErrors to mark field that are still invalid. But once I start editing other fields (not the ones marked using showErrors), even with valid values, the ones marked with showErrors starting to show just generic error from preconfigured validator.

It is not easy to explain the case, might be easier to go through the steps below.

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://codepen.io/Alexey-Anufriev/pen/ogvwydo
  2. Fill both input fields
  3. Press 'save' button
  4. See 'custom err'
  5. Put the cursor into the second input field
  6. Type any character
  7. See 'required in' error

Expected behavior

Since the field was not touched after the validation I would expect custom validation to stay until the exact field is modified.

Additional context

Unfortunately, I cannot use custom validators for each field separately that will go and check each value on the backend.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions