Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
fix: add aria-alert for spinner (#633)
Browse files Browse the repository at this point in the history
* fix: add announcement for loading spinner
  • Loading branch information
mattmazzola authored Jun 27, 2018
1 parent c223b27 commit 0354be5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
4 changes: 4 additions & 0 deletions public/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,10 @@ i[data-icon-name="Delete"]:hover, i[data-icon-name="Edit"]:hover{
box-shadow: none !important;
position: relative;
}
.cl-screen-reader {
position: absolute;
left: -999em;
}

.cl-chatmodal {
height: 100%;
Expand Down
27 changes: 16 additions & 11 deletions src/components/modals/SpinnerWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,22 @@ const debug = false;
class SpinnerWindow extends React.Component<Props, {}> {
render() {
return (
<Modal
isOpen={this.props.displaySpinner.length > 0}
isBlocking={true}
containerClassName='cl-spinner'>
<Spinner size={SpinnerSize.large} />
{debug &&
<div>
{this.props.displaySpinner.join("\n\n")}
</div>
}
</Modal>
<React.Fragment>
<Modal
isOpen={this.props.displaySpinner.length > 0}
isBlocking={true}
containerClassName='cl-spinner'>
<Spinner size={SpinnerSize.large} />
{debug &&
<div>
{this.props.displaySpinner.join("\n\n")}
</div>
}
</Modal>
<div role="alert" aria-live="assertive" className="cl-spinner-aria">
{this.props.displaySpinner.length > 0 && <span className="cl-screen-reader">Loading</span>}
</div>
</React.Fragment>
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/routes/Apps/App/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Dashboard extends React.Component<Props, ComponentState> {
iconProps={{ iconName: 'Sync' }}
/>
<div role="alert" aria-live="assertive">
{this.state.retrying && <span className="cl-dashboard-retry">Retrying</span>}
{this.state.retrying && <span className="cl-screen-reader">Retrying</span>}
</div>
</div>
)}
Expand Down

0 comments on commit 0354be5

Please sign in to comment.