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
15 changes: 15 additions & 0 deletions common/changes/SearchBox-allow-aria-label_2017-05-04-06-49.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"changes": [
{
"packageName": "office-ui-fabric-react",
"comment": "SearchBox: added the ariaLabel optional property",
"type": "minor"
},
{
"comment": "",
"packageName": "@uifabric/utilities",
"type": "none"
}
],
"email": "jakob101@gmail.com"
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,10 @@ export interface ISearchBoxProps extends React.Props<SearchBox> {
* CSS class to apply to the SearchBox.
*/
className?: string;

/**
* The aria label of the SearchBox for the benefit of screen readers.
* @defaultvalue labelText
*/
ariaLabel?: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export class SearchBox extends BaseComponent<ISearchBoxProps, ISearchBoxState> {
onInput={ this._onInputChange }
onKeyDown={ this._onKeyDown }
value={ value }
aria-label={ this.props.ariaLabel ? this.props.ariaLabel : this.props.labelText }
ref={ this._resolveRef('_inputElement') }
/>
<div
Expand Down