Skip to content

Commit f3254e0

Browse files
authored
Merge pull request #435 from ownego/update/custom-props-checkbox
Update: custom props for checkboxes
2 parents 2973106 + a9f70ba commit f3254e0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/components/Checkbox/Checkbox.vue

+8-1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ export interface CheckboxProps extends ChoiceBleedProps {
114114
error?: Error | boolean;
115115
/** Indicates the tone of the checkbox */
116116
tone?: 'magic';
117+
/** Disable auto focus to input when click to checkbox*/
118+
disableFocus?: boolean;
117119
}
118120
119121
type CheckboxSlots = {
@@ -233,7 +235,12 @@ const handleOnClick = () => {
233235
}
234236
235237
model.value = inputNode.value.checked;
236-
inputNode.value.focus();
238+
239+
// Props use for fix case Checkbox use as slot of Combobox Component -> auto close popover when change focus
240+
if (!props.disableFocus) {
241+
inputNode.value.focus();
242+
}
243+
237244
emits('change', inputNode.value.checked, props.value || id.value);
238245
};
239246
</script>

0 commit comments

Comments
 (0)