Skip to content

fix(Button): correct loading alignment #6095

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/light-pants-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

fix(Button): correct loading alignment
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exports[`AnchoredOverlay > should render consistently when open 1`] = `
aria-describedby=":rd:-loading-announcement"
aria-expanded="true"
aria-haspopup="true"
class="_ButtonBase_130zs_2"
class="_ButtonBase_149hc_2"
data-loading="false"
data-no-visuals="true"
data-size="medium"
Expand All @@ -23,12 +23,12 @@ exports[`AnchoredOverlay > should render consistently when open 1`] = `
type="button"
>
<span
class="_ButtonContent_130zs_101"
class="_ButtonContent_149hc_101"
data-align="center"
data-component="buttonContent"
>
<span
class="_Label_130zs_128"
class="_Label_149hc_128"
data-component="text"
>
Anchor Button
Expand Down
8 changes: 8 additions & 0 deletions packages/react/src/Button/ButtonBase.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,14 @@
}
}

/* Styles for the spinner element displayed when the Button is in a loading state.
* Ensures the spinner is centered within its container. */
.LoadingSpinner {
display: flex;
align-items: center;
justify-content: center;
}

/* Default Variant */

&:where([data-variant='default']) {
Expand Down
Loading