Shouldn't form.setFieldValue
trigger the field validation by default?
#1236
Replies: 1 comment
-
@rodrigofariow bare with me as I'm fairly new, but I'm going to say this is intentional... form.setFieldValue is used globally thought the library for setting values, you'll find it in formApi multiple times and fieldApi also a couple. So there's situations where we don't want to re-validate the field when we call it by default. However if you take a peek into the source code, you'll see that for the setValue for Field we're actually doing exactly what you are: ![]() Where |
Beta Was this translation helpful? Give feedback.
-
I'm trying to update a
fieldA
value programmatically from anywhere else besides it's own<form.Field name="fieldA" />
usage, I have found 2 ways to force validation to run:I would expect validation to run when using
setFieldValue
since it does updatemeta
data too. But it does not.Is this intentional?
NOTE:
My use case is NOT a linked field.
Cheers
Beta Was this translation helpful? Give feedback.
All reactions