From 3e0f9a47369edac32d0c8a068f8b61d8f761458f Mon Sep 17 00:00:00 2001 From: Abdelrahman Awad Date: Sat, 5 Dec 2020 15:38:44 +0200 Subject: [PATCH] fix: cast radio buttons value correctly closes #3064 --- packages/vee-validate/src/utils/events.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/vee-validate/src/utils/events.ts b/packages/vee-validate/src/utils/events.ts index 1772c2047..62c6167da 100644 --- a/packages/vee-validate/src/utils/events.ts +++ b/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) { @@ -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; }