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
I suggest we add validated property of the field stating that the field has been validated.
Why
Now we have separate validatedSync and validatedAsync. They are great for granular logic, but in cases you need just to react in UI if the field has been validated, regardless of the validation type, the property is missing.
How
Tight together validatedSync and validatedAsync at the certain point of validation, and assign into a dedicated prop.
The text was updated successfully, but these errors were encountered:
validated is, probably, most reliable to compose within Form.validateField() method.
It needs to be reset to false when the validation begins, and back to true when it ends. The only place controlling this behavior is the mentioned Form's method. Other helper utils are rather pure functions, and bringing the beginning/end context to them would be redundant.
Just as mentioned, validated is set during the Form.validateField() method, depending on the respective prop from the validation function's propsPatch Map. Each field onChange event resets the validated prop, as well as other similar props, to false.
At the moment fields with no validation needed will always have validated set to false, and I find this a proper behavior, since no validation was intended to happen at the first place.
What
I suggest we add
validated
property of the field stating that the field has been validated.Why
Now we have separate
validatedSync
andvalidatedAsync
. They are great for granular logic, but in cases you need just to react in UI if the field has been validated, regardless of the validation type, the property is missing.How
validatedSync
andvalidatedAsync
at the certain point of validation, and assign into a dedicated prop.The text was updated successfully, but these errors were encountered: