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
  • Loading branch information
zzcr committed Dec 2, 2024
1 parent 74bfd1c commit b01e609
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 b01e609

Please sign in to comment.