fix(ui): apply className only to root element in ButtonIcon

Remove duplicate className application from inner elements (content and spinner).
The className prop should only be applied to the root button element, matching
the behavior of the Button component.

Signed-off-by: Johan Persson <johanopersson@gmail.com>
This commit is contained in:
Johan Persson
2025-11-26 17:41:51 +01:00
parent 2744cbaad7
commit 5bacf55cd7
3 changed files with 8 additions and 2 deletions
+7
View File
@@ -0,0 +1,7 @@
---
'@backstage/ui': patch
---
Fixed `ButtonIcon` incorrectly applying `className` to inner elements instead of only the root element.
Affected components: ButtonIcon
+1
View File
@@ -0,0 +1 @@
Fix incorrectly applying className to three elements internally in ButtonIcon.
@@ -64,7 +64,6 @@ export const ButtonIcon = forwardRef(
classNamesButtonIcon.content,
stylesButton[classNames.content],
stylesButtonIcon[classNamesButtonIcon.content],
className,
)}
>
{icon}
@@ -79,7 +78,6 @@ export const ButtonIcon = forwardRef(
classNamesButtonIcon.spinner,
stylesButton[classNames.spinner],
stylesButtonIcon[classNamesButtonIcon.spinner],
className,
)}
>
<RiLoader4Line aria-hidden="true" />