From 3300b9d47b725f5b365bec0e8eb32d1d2bb1794e Mon Sep 17 00:00:00 2001 From: Kai Arrowood Date: Thu, 15 Aug 2024 11:04:59 -0400 Subject: [PATCH] feat(kradio): support setting to null (#2342) Support setting the `modelValue` to `null` to unset the selection. --- src/components/KRadio/KRadio.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/KRadio/KRadio.vue b/src/components/KRadio/KRadio.vue index f9d4bd3b33..a1562f3751 100644 --- a/src/components/KRadio/KRadio.vue +++ b/src/components/KRadio/KRadio.vue @@ -99,7 +99,7 @@ const props = defineProps({ * Sets whether or not radio is selected */ modelValue: { - type: [String, Number, Boolean, Object], + type: [String, Number, Boolean, Object, null] as PropType, required: true, }, /** @@ -172,8 +172,8 @@ const hasTooltip = computed((): boolean => !!slots.tooltip) const isChecked = computed((): boolean => props.selectedValue === props.modelValue) const emit = defineEmits<{ - (e: 'change', value: string | boolean | number | object): void - (e: 'update:modelValue', value: string | boolean | number | object): void + (e: 'change', value: string | boolean | number | object | null): void + (e: 'update:modelValue', value: string | boolean | number | object | null): void }>() const handleClick = (): void => {