Skip to content

Commit 60e5402

Browse files
authored
fix: [button-group] fixed the bug that multiple clicks on the same button would trigger multiple events (#2590)
1 parent c9464fd commit 60e5402

File tree

1 file changed

+1
-1
lines changed
  • packages/renderless/src/button-group

1 file changed

+1
-1
lines changed

packages/renderless/src/button-group/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const handleChange =
2222
export const handleClick =
2323
({ emit, props, state }: Pick<IButtonGroupRenderlessParams, 'emit' | 'props' | 'state'>) =>
2424
(node: IButtonGroupNode): void => {
25-
if (!state.disabled && !node.disabled) {
25+
if (!state.disabled && !node.disabled && state.value !== node[props.valueField]) {
2626
state.value = node[props.valueField]
2727
emit('update:modelValue', state.value)
2828
}

0 commit comments

Comments
 (0)