Skip to content

Commit

Permalink
fix: add size prop to prefix/suffix icon only if it doesn't size prop
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadshaheer committed Mar 2, 2025
1 parent 08810f6 commit 9149921
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/button/src/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ const Button = forwardRef<HTMLButtonElement, ButtonProps>(
{prefixIcon && (
<span>
{React.cloneElement(prefixIcon, {
size: iconSizes[size],
...(!prefixIcon.props.size && { size: iconSizes[size] }),
})}
</span>
)}
{children}
{suffixIcon && (
<span>
{React.cloneElement(suffixIcon, {
size: iconSizes[size],
...(!suffixIcon.props.size && { size: iconSizes[size] }),
})}
</span>
)}
Expand Down

0 comments on commit 9149921

Please sign in to comment.