-
I'm running into some issues when doing I've a preproduction URL here: This example uses My question is, once the I wonder if I'm missing something or doing it in a wrong way. Appreciate any help 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Yep, the entire schema is re-run regardless of what field has changed. This may seem counter-intuitive but it is the most sound strategy in terms of validation correctness. If you have refines that rely on other field values, they won't run unless the entire thing runs. So it's dangerous to assume we could validate each changed field in isolation. It could be possible in upcoming releases since we started doing schema analysis in recent commits to get the "required" state. We could scan for "side effects" in the schema and determine if we can run each field/path validation schema in isolation. For your case, a workaround is to use field-level validation schemas, you can pass each field its schema part and it should only run whenever that field changes. |
Beta Was this translation helpful? Give feedback.
-
Thanks for taking the time @logaretm One other thing I noticed is that the flag Is this a bug, or bad implementation on the reproduction URL ? https://stackblitz.com/edit/vee-validate-v4-async-validation-jghdg8?file=src%2FApp.vue Thanks Editing: { handleBlur } should be used in this case right ? |
Beta Was this translation helpful? Give feedback.
Yep, the entire schema is re-run regardless of what field has changed. This may seem counter-intuitive but it is the most sound strategy in terms of validation correctness.
If you have refines that rely on other field values, they won't run unless the entire thing runs. So it's dangerous to assume we could validate each changed field in isolation.
It could be possible in upcoming releases since we started doing schema analysis in recent commits to get the "required" state. We could scan for "side effects" in the schema and determine if we can run each field/path validation schema in isolation.
For your case, a workaround is to use field-level validation schemas, you can pass each field it…