Skip to content

Commit

Permalink
fix: cast radio buttons value correctly closes #3064
Browse files Browse the repository at this point in the history
  • Loading branch information
logaretm committed Dec 5, 2020
1 parent b16fc94 commit 3e0f9a4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/vee-validate/src/utils/events.ts
@@ -1,4 +1,5 @@
import { isCallable } from '../../../shared';
import { hasCheckedAttr } from './assertions';

export const isEvent = (evt: any): evt is Event => {
if (!evt) {
Expand Down Expand Up @@ -26,7 +27,7 @@ export function normalizeEventValue(value: unknown): any {
const input = value.target as HTMLInputElement;
// Vue sets the current bound value on `_value` prop
// for checkboxes it it should fetch the value binding type as is (boolean instead of string)
if (input.type === 'checkbox' && '_value' in input) {
if (hasCheckedAttr(input.type) && '_value' in input) {
return (input as any)._value;
}

Expand Down

0 comments on commit 3e0f9a4

Please sign in to comment.