Skip to content

Commit

Permalink
feat(AlphaButton): enhance disabled prop logic to account for loading…
Browse files Browse the repository at this point in the history
… state
  • Loading branch information
jintak0401 committed Dec 2, 2024
1 parent 3fb4f68 commit 16a1ec6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/bezier-react/src/components/AlphaButton/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,15 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
active,
className,
loading,
disabled: disabledProp,
...rest
},
forwardedRef
) {
const Comp = as as typeof BaseButton

const disabled = loading || disabledProp

return (
<Comp
ref={forwardedRef}
Expand All @@ -88,6 +91,7 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
active && styles.active,
className
)}
disabled={disabled}
{...rest}
>
<div
Expand Down

0 comments on commit 16a1ec6

Please sign in to comment.