Skip to content

Commit

Permalink
Hide Button's loading label (#2247)
Browse files Browse the repository at this point in the history
  • Loading branch information
connor-baer authored Sep 11, 2023
1 parent 4adbdd5 commit 390d1e4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/six-buttons-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sumup/circuit-ui': patch
---

Hid the Button's loading label in JSDOM environments.
6 changes: 5 additions & 1 deletion packages/circuit-ui/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,11 @@ export const Button = forwardRef<any, ButtonProps>(
)}
ref={ref}
>
<Spinner className={classes.spinner} size="byte">
<Spinner
className={classes.spinner}
size="byte"
aria-hidden={!isLoading}
>
<span className={utilityClasses.hideVisually}>{loadingLabel}</span>
</Spinner>
<span className={classes.content}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ exports[`Sidebar > should render and match snapshot when open 1`] = `
type="button"
>
<span
aria-hidden="true"
class="_base_2b3edd _byte_2b3edd _spinner_892426"
>
<span
Expand Down Expand Up @@ -219,6 +220,7 @@ exports[`Sidebar > should render and match the snapshot when closed 1`] = `
type="button"
>
<span
aria-hidden="true"
class="_base_2b3edd _byte_2b3edd _spinner_892426"
>
<span
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ exports[`CloseButton > styles > should render and match snapshot when not visibl
type="button"
>
<span
aria-hidden="true"
class="_base_2b3edd _byte_2b3edd _spinner_892426"
>
<span
Expand Down Expand Up @@ -83,6 +84,7 @@ exports[`CloseButton > styles > should render and match snapshot when visible 1`
type="button"
>
<span
aria-hidden="true"
class="_base_2b3edd _byte_2b3edd _spinner_892426"
>
<span
Expand Down

1 comment on commit 390d1e4

@vercel
Copy link

@vercel vercel bot commented on 390d1e4 Sep 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.