Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/components/Checkbox/Checkbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ export interface CheckboxProps extends ChoiceBleedProps {
error?: Error | boolean;
/** Indicates the tone of the checkbox */
tone?: 'magic';
/** Disable auto focus to input when click to checkbox*/
disableFocus?: boolean;
}

type CheckboxSlots = {
Expand Down Expand Up @@ -233,7 +235,12 @@ const handleOnClick = () => {
}

model.value = inputNode.value.checked;
inputNode.value.focus();

// Props use for fix case Checkbox use as slot of Combobox Component -> auto close popover when change focus
if (!props.disableFocus) {
inputNode.value.focus();
}

emits('change', inputNode.value.checked, props.value || id.value);
};
</script>