Skip to content
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
8 changes: 8 additions & 0 deletions change/office-ui-fabric-react-2019-07-25-14-46-34-master.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"comment": "consume suggestionsAvailableAlertText prop to floating picker, so that the screen readers can announce the apperance of suggestions when the prop is set.",
"type": "patch",
"packageName": "office-ui-fabric-react",
"email": "email not defined",
"commit": "98295b29d8f60465f38c8ec2ccc10c554f3dca78",
"date": "2019-07-25T21:46:34.091Z"
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
} from './Suggestions.types';
import { SuggestionsCore } from './SuggestionsCore';
import * as stylesImport from './SuggestionsControl.scss';
import { hiddenContentStyle, mergeStyles } from 'office-ui-fabric-react/lib/Styling';

// tslint:disable-next-line:no-any
const styles: any = stylesImport;
Expand Down Expand Up @@ -91,13 +92,22 @@ export class SuggestionsControl<T> extends BaseComponent<ISuggestionsControlProp
}

public render(): JSX.Element {
const { className, headerItemsProps, footerItemsProps } = this.props;
const { className, headerItemsProps, footerItemsProps, suggestionsAvailableAlertText } = this.props;

const screenReaderTextStyles = mergeStyles(hiddenContentStyle);
const shouldAlertSuggestionsAvailableText =
this.state.suggestions && this.state.suggestions.length > 0 && suggestionsAvailableAlertText;

return (
<div className={css('ms-Suggestions', className ? className : '', styles.root)}>
{headerItemsProps && this.renderHeaderItems()}
{this._renderSuggestions()}
{footerItemsProps && this.renderFooterItems()}
{shouldAlertSuggestionsAvailableText ? (
<span role="alert" aria-live="polite" className={screenReaderTextStyles}>
{suggestionsAvailableAlertText}
</span>
) : null}
</div>
);
}
Expand Down