You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are you submitting a bug report or a feature request?
bug report.
What is the current behavior?
After validate function returns an error for the field it's not cleared even the error is fixed later.
What is the expected behavior?
It should clear stale errors.
Sandbox Link
I created a simple sandbox to showcase the issue. To reproduce, first enter let's say a number 3 in the first field and number 1 in the second one. You will get an error that field1 must be lower than field2. Then edit field2 to have a value bigger then field1 but the error remains despite the fact that validate function is triggered each time.
Latest versions of the lib (visible in codesandbox deps)
Other information
I think this is an issue because form fields usually don't know about each other and the relations/logic between them as they often reside in different components but the form validation function (or some other container component) does.
The text was updated successfully, but these errors were encountered:
This is exactly what the validateFields prop is for. If you specify validateFields={['field1']} for the second field, it works. By setting validateFields={[]}, you are saying, "Don't run the validation for any other field when this one changes."
I know that but I am talking about form level validation which should not rely on validateFields prop. If I'm wrong why validation is run first time at all?
Are you submitting a bug report or a feature request?
bug report.
What is the current behavior?
After
validate
function returns an error for the field it's not cleared even the error is fixed later.What is the expected behavior?
It should clear stale errors.
Sandbox Link
I created a simple sandbox to showcase the issue. To reproduce, first enter let's say a number 3 in the first field and number 1 in the second one. You will get an error that field1 must be lower than field2. Then edit field2 to have a value bigger then field1 but the error remains despite the fact that validate function is triggered each time.
https://codesandbox.io/s/zk6my5klx
What's your environment?
Latest versions of the lib (visible in codesandbox deps)
Other information
I think this is an issue because form fields usually don't know about each other and the relations/logic between them as they often reside in different components but the form validation function (or some other container component) does.
The text was updated successfully, but these errors were encountered: