-
Notifications
You must be signed in to change notification settings - Fork 92
Description
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:
- Go to https://codepen.io/Alexey-Anufriev/pen/ogvwydo
- Fill both input fields
- Press 'save' button
- See 'custom err'
- Put the cursor into the second input field
- Type any character
- 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.