Skip to content

Commit

Permalink
fix: add live region to loading indicator
Browse files Browse the repository at this point in the history
So screen readers will read out "Loading"
  • Loading branch information
ahuth committed Nov 29, 2023
1 parent eb6870f commit 75dfdce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ exports[`<LoadingIndicator /> Default story renders snapshot 1`] = `
/>
</div>
<span
aria-live="polite"
class="css-1xm9l9z"
role="status"
>
Loading
</span>
Expand Down
4 changes: 3 additions & 1 deletion packages/components/src/core/LoadingIndicator/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ const LoadingIndicator = ({ sdsStyle }: LoadingIndicatorProps): JSX.Element => {
return (
<StyledLoadingIndicator sdsStyle={sdsStyle}>
<Icon sdsIcon="loading" sdsSize="l" sdsType="static" />
<StyledText>Loading</StyledText>
<StyledText aria-live="polite" role="status">
Loading
</StyledText>
</StyledLoadingIndicator>
);
};
Expand Down

0 comments on commit 75dfdce

Please sign in to comment.