Skip to content

Commit

Permalink
chore: prevent click handler execution when button is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
langemike committed Mar 26, 2024
1 parent f1bba38 commit 96882eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ui-react/src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const Button: React.FC<Props> = ({
}

return (
<button className={buttonClassName(active)} onClick={onClick} type={type} aria-disabled={disabled} {...rest}>
<button className={buttonClassName(active)} onClick={disabled ? undefined : onClick} type={type} aria-disabled={disabled} {...rest}>
{content}
</button>
);
Expand Down

0 comments on commit 96882eb

Please sign in to comment.