From 5bacf55cd74fe2e36032a176ae827c37600b917c Mon Sep 17 00:00:00 2001 From: Johan Persson Date: Wed, 26 Nov 2025 17:41:51 +0100 Subject: [PATCH] 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 --- .changeset/common-coins-stare.md | 7 +++++++ .patches/pr-31900.txt | 1 + packages/ui/src/components/ButtonIcon/ButtonIcon.tsx | 2 -- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .changeset/common-coins-stare.md create mode 100644 .patches/pr-31900.txt diff --git a/.changeset/common-coins-stare.md b/.changeset/common-coins-stare.md new file mode 100644 index 0000000000..0bd0078cf9 --- /dev/null +++ b/.changeset/common-coins-stare.md @@ -0,0 +1,7 @@ +--- +'@backstage/ui': patch +--- + +Fixed `ButtonIcon` incorrectly applying `className` to inner elements instead of only the root element. + +Affected components: ButtonIcon diff --git a/.patches/pr-31900.txt b/.patches/pr-31900.txt new file mode 100644 index 0000000000..43616d0e98 --- /dev/null +++ b/.patches/pr-31900.txt @@ -0,0 +1 @@ +Fix incorrectly applying className to three elements internally in ButtonIcon. \ No newline at end of file diff --git a/packages/ui/src/components/ButtonIcon/ButtonIcon.tsx b/packages/ui/src/components/ButtonIcon/ButtonIcon.tsx index d3596da799..9bbeca9d5b 100644 --- a/packages/ui/src/components/ButtonIcon/ButtonIcon.tsx +++ b/packages/ui/src/components/ButtonIcon/ButtonIcon.tsx @@ -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, )} >