form icon indicating copy to clipboard operation
form copied to clipboard

Perform non-async validation on touched

Open tiffwu opened this issue 8 years ago • 7 comments

I see that currently setTouched triggers only async validation. Is there any way to also have setTouched trigger non-async validation?

tiffwu avatar Dec 07 '17 18:12 tiffwu

Actually, I'm going to just pop my synchronous validators into asyncValidators. Closing this issue.

tiffwu avatar Dec 07 '17 19:12 tiffwu

Alright, this is still an issue. I can't use async validators to validate my form state based on multiple fields (e.g. require billing address only if "Separate shipping and billing address" is checked). Is there any other way to trigger validations after each field is setTouched?

tiffwu avatar Dec 17 '17 06:12 tiffwu

Ahh im pretty sure it validates on set tocued

joepuzzo avatar Dec 18 '17 01:12 joepuzzo

Hmm i just tool a look. It does when you set value i.e touch a field.. maybe i will update but i have to think if this is a breaking change

joepuzzo avatar Dec 18 '17 01:12 joepuzzo

No worries, I'll survive without it.

tiffwu avatar Dec 19 '17 03:12 tiffwu

I think im going to add this as i don't think it will be a breaking change. it will simply call sync validation one extra time.

joepuzzo avatar Dec 20 '17 14:12 joepuzzo

This is fixed.

joepuzzo avatar Dec 21 '17 18:12 joepuzzo