Skip to content

Commit 9149921

Browse files
committed
fix: add size prop to prefix/suffix icon only if it doesn't size prop
1 parent 08810f6 commit 9149921

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/button/src/button.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ const Button = forwardRef<HTMLButtonElement, ButtonProps>(
8888
{prefixIcon && (
8989
<span>
9090
{React.cloneElement(prefixIcon, {
91-
size: iconSizes[size],
91+
...(!prefixIcon.props.size && { size: iconSizes[size] }),
9292
})}
9393
</span>
9494
)}
9595
{children}
9696
{suffixIcon && (
9797
<span>
9898
{React.cloneElement(suffixIcon, {
99-
size: iconSizes[size],
99+
...(!suffixIcon.props.size && { size: iconSizes[size] }),
100100
})}
101101
</span>
102102
)}

0 commit comments

Comments
 (0)