Skip to content

Commit

Permalink
fix(checkbox): onClick event triggered twice (#5363)
Browse files Browse the repository at this point in the history
Co-authored-by: 张宏亮 <hongliang@yunshan.net>
  • Loading branch information
zhl1232 and zhl1232 authored Mar 20, 2022
1 parent 17acda5 commit 47e218d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export default defineComponent({
id,
prefixCls: prefixCls.value,
...restAttrs,
onClick,
};
if (checkboxGroup && !skipGroup) {
checkboxProps.onChange = (...args) => {
Expand Down Expand Up @@ -103,7 +104,6 @@ export default defineComponent({
style={style}
onMouseenter={onMouseenter as EventHandler}
onMouseleave={onMouseleave as EventHandler}
onClick={onClick}
>
<VcCheckbox {...checkboxProps} class={checkboxClass} ref={checkboxRef} />
{children.length ? <span>{children}</span> : null}
Expand Down

0 comments on commit 47e218d

Please sign in to comment.