Skip to content
Closed
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "office-ui-fabric-react",
"comment": "Add aria label prop for clear button in searchbox",
"type": "patch"
}
],
"packageName": "office-ui-fabric-react",
"email": "[email protected]"
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,12 @@ export class SearchBoxBase extends BaseComponent<ISearchBoxProps, ISearchBoxStat
/>
{ value!.length > 0 &&
<div className={ classNames.clearButton }>
<IconButton styles={ { root: { height: 'auto' }, icon: { fontSize: '12px' } } } onClick={ this._onClearClick } iconProps={ { iconName: 'Clear' } } />
<IconButton
styles={ { root: { height: 'auto' }, icon: { fontSize: '12px' } } }
onClick={ this._onClearClick }
iconProps={ { iconName: 'Clear' } }
ariaLabel={ this.props.clearButtonAriaLabel }
/>
</div>
}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ export interface ISearchBoxProps extends React.InputHTMLAttributes<HTMLInputElem
*/
ariaLabel?: string;

/**
* The aria label of the clear button for the benefit of screen readers.
*/
clearButtonAriaLabel?: string;

/**
* Whether or not the SearchBox is underlined.
* @default false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export class SearchBoxSmallExample extends React.Component<any, any> {
return (
<div className='ms-SearchBoxSmallExample'>
<SearchBox
clearButtonAriaLabel='Clear Searchbox'
onEscape={ (ev) => {
console.log('Custom onEscape Called');
} }
Expand Down