Skip to content

Commit 1660048

Browse files
committed
fix: define binds not respecting config events
1 parent 52bd89f commit 1660048

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

.changeset/old-donuts-argue.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'vee-validate': patch
3+
---
4+
5+
fix: define binds not respecting config events

packages/vee-validate/src/useForm.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -933,20 +933,14 @@ export function useForm<
933933

934934
function onInput(e: Event) {
935935
const value = normalizeEventValue(e) as PathValue<TValues, TPath>;
936-
setFieldValue(pathState.path as Path<TValues>, value);
937936
const validateOnInput = evalConfig().validateOnInput ?? getConfig().validateOnInput;
938-
if (validateOnInput) {
939-
validateField(pathState.path as Path<TValues>);
940-
}
937+
setFieldValue(pathState.path as Path<TValues>, value, validateOnInput);
941938
}
942939

943940
function onChange(e: Event) {
944941
const value = normalizeEventValue(e) as PathValue<TValues, TPath>;
945-
setFieldValue(pathState.path as Path<TValues>, value);
946942
const validateOnChange = evalConfig().validateOnChange ?? getConfig().validateOnChange;
947-
if (validateOnChange) {
948-
validateField(pathState.path as Path<TValues>);
949-
}
943+
setFieldValue(pathState.path as Path<TValues>, value, validateOnChange);
950944
}
951945

952946
const props = computed(() => {

0 commit comments

Comments
 (0)