Skip to content

Commit

Permalink
feat(kradio): support setting to null (#2342)
Browse files Browse the repository at this point in the history
Support setting the `modelValue` to `null` to unset the selection.
  • Loading branch information
kaiarrowood authored Aug 15, 2024
1 parent 3619f0b commit 3300b9d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/KRadio/KRadio.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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<string | number | boolean | object | null>,
required: true,
},
/**
Expand Down Expand Up @@ -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 => {
Expand Down

0 comments on commit 3300b9d

Please sign in to comment.