Skip to content
Merged
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "office-ui-fabric-react",
"comment": "Add clearButtonAriaLabel and clearButtonAriaDescription props to SearchBox.types.ts and pass them to the icon button in SearchBox.base.tsx",
"type": "minor"
}
],
"packageName": "office-ui-fabric-react",
"email": "cohoov@microsoft.com"
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,13 @@ 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 }
ariaDescription={ this.props.clearButtonAriaDescription }
/>
</div>
}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ export interface ISearchBoxProps extends React.InputHTMLAttributes<HTMLInputElem
*/
ariaLabel?: string;

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we need to remove this. right ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done.

/**
* The aria description of the clear button for the SearchBox for the benefit of screen readers.
*/
clearButtonAriaDescription?: string;

@manishgarg1 manishgarg1 Feb 12, 2018

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hi,

we believe that these props be a part of the clearButtonProps property bag. That would make it easier to evolve the APIs.

clearButtonProps: {
ariaLabel;
ariaDescription:
} #Resolved


/**
* Whether or not the SearchBox is underlined.
* @default false
Expand Down