Skip to content

Commit

Permalink
fix: UiToggleButton modelValue typing error (NOTICKET) (#539)
Browse files Browse the repository at this point in the history
Co-authored-by: Alan Leszczuk <[email protected]>
  • Loading branch information
AlanLes and Alan Leszczuk authored Jan 15, 2025
1 parent c595cd4 commit a5701a7
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@ if (!parentComponent || parentComponent.type.name !== 'UiToggleButtonGroup') {
throw new Error('UiToggleButton has to be child of UiToggleButtonGroup');
}
}
const modelValue = inject<WritableComputedRef<ToggleButtonGroupProps['modelValue']>>('modelValue', computed(() => ''));
const modelValue = inject<WritableComputedRef<ToggleButtonGroupProps['modelValue']>>(
'modelValue',
computed({
get: () => '',
set: (value) => value,
}),
);
const isChecked = computed(() => (modelValue && equal(modelValue.value, props.value)));
const clickHandler = () => {
modelValue.value = props.value;
Expand Down

0 comments on commit a5701a7

Please sign in to comment.