Skip to content

Commit

Permalink
fix(Button): update disabled prop logic to consider loading state
Browse files Browse the repository at this point in the history
  • Loading branch information
jintak0401 committed Dec 2, 2024
1 parent 0d72460 commit f1def31
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/bezier-react/src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
className,
text,
loading = false,
disabled = loading,
disabled: disabledProp = false,
active = false,
size = 'm',
styleVariant = 'primary',
Expand All @@ -109,6 +109,8 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
) {
const Comp = as as typeof BaseButton

const disabled = loading || disabledProp

const handleClick = useCallback<React.MouseEventHandler<HTMLButtonElement>>(
(event) => {
if (!disabled) {
Expand Down

0 comments on commit f1def31

Please sign in to comment.