Skip to content

Commit

Permalink
fix: [button-group] fixed the bug that multiple clicks on the same bu…
Browse files Browse the repository at this point in the history
…tton would trigger multiple events (#2590)
  • Loading branch information
zzcr authored Dec 3, 2024
1 parent c9464fd commit 60e5402
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/renderless/src/button-group/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const handleChange =
export const handleClick =
({ emit, props, state }: Pick<IButtonGroupRenderlessParams, 'emit' | 'props' | 'state'>) =>
(node: IButtonGroupNode): void => {
if (!state.disabled && !node.disabled) {
if (!state.disabled && !node.disabled && state.value !== node[props.valueField]) {
state.value = node[props.valueField]
emit('update:modelValue', state.value)
}
Expand Down

0 comments on commit 60e5402

Please sign in to comment.