Skip to content

Commit

Permalink
fix: ensure validation if we skip checkbox value setting #3927 (#3930)
Browse files Browse the repository at this point in the history
  • Loading branch information
logaretm committed Sep 18, 2022
1 parent 771e7f2 commit 82d05db
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/vee-validate/src/useField.ts
Expand Up @@ -451,6 +451,9 @@ function useCheckboxField<TValue = unknown>(

function handleCheckboxChange(e: unknown, shouldValidate = true) {
if (checked.value === ((e as Event)?.target as HTMLInputElement)?.checked) {
if (shouldValidate) {
field.validate();
}
return;
}

Expand Down

0 comments on commit 82d05db

Please sign in to comment.