Skip to content
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

Fix: screen reader announces search results status message #644

Merged
merged 3 commits into from
Jul 21, 2020
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
11 changes: 10 additions & 1 deletion src/app/views/query-runner/request/permissions/PanelList.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import { DetailsList, DetailsListLayoutMode, IColumn, Label, SearchBox, SelectionMode } from 'office-ui-fabric-react';
import {
Announced,
DetailsList,
DetailsListLayoutMode,
IColumn,
Label,
SearchBox,
SelectionMode
} from 'office-ui-fabric-react';
import React from 'react';
import { FormattedMessage } from 'react-intl';

Expand Down Expand Up @@ -37,6 +45,7 @@ const PanelList = ({ messages, permissions,
searchValueChanged(event, newValue)}
styles={{ field: { paddingLeft: 10 } }}
/>
<Announced message={`${permissions.length} search results available.`}/>
Copy link

Choose a reason for hiding this comment

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

string localization

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since it's only a message that is being read, I tested this out with a Spanish narrator, and the narrator translates it itself

Copy link
Collaborator

Choose a reason for hiding this comment

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

Does the announce message get triggered only when a search has happened?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah it does

<hr />
<DetailsList
onShouldVirtualize={() => false}
Expand Down
22 changes: 18 additions & 4 deletions src/app/views/sidebar/sample-queries/SampleQueries.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
import {
DetailsList, DetailsRow, FontSizes,
FontWeights, getId, GroupHeader, IColumn, Icon,
MessageBar, MessageBarType, SearchBox,
SelectionMode, Spinner, SpinnerSize, styled, TooltipHost
Announced,
DetailsList,
DetailsRow,
FontSizes,
FontWeights,
getId,
GroupHeader,
IColumn,
Icon,
MessageBar,
MessageBarType,
SearchBox,
SelectionMode,
Spinner,
SpinnerSize,
styled,
TooltipHost
} from 'office-ui-fabric-react';
import React, { ChangeEvent, Component } from 'react';
import { FormattedMessage, injectIntl } from 'react-intl';
Expand Down Expand Up @@ -333,6 +346,7 @@ export class SampleQueries extends Component<ISampleQueriesProps, any> {
<FormattedMessage id='Microsoft Graph API Reference docs' />
</a>
</MessageBar>
<Announced message={`${groupedList.samples.length} search results available.`}/>
<DetailsList className={classes.queryList}
cellStyleProps={{
cellRightPadding: 0,
Expand Down