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

Added consistent aria levels to any role='heading' #5782

Merged
merged 2 commits into from
Aug 9, 2018
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "office-ui-fabric-react",
"comment": "Removed unnecessary heading roles, and added aria-level to those requiring them",
"type": "patch"
}
],
"packageName": "office-ui-fabric-react",
"email": "[email protected]"
}
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ export class ComboBox extends BaseComponent<IComboBoxProps, IComboBoxState> {
const { onRenderOption = this._onRenderOptionContent } = this.props;

return (
<div key={item.key} className={this._classNames.header} role="heading">
<div key={item.key} className={this._classNames.header}>
{onRenderOption(item, this._onRenderOptionContent)}
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,7 @@ export class ContextualMenuBase extends BaseComponent<IContextualMenuProps, ICon
onKeyDown={this._onMenuKeyDown}
onKeyUp={this._onKeyUp}
>
{title && (
<div className={this._classNames.title} role="heading" aria-level={1}>
{' '}
{title}{' '}
</div>
)}
{title && <div className={this._classNames.title}> {title} </div>}
{items && items.length ? (
<FocusZone
{...this._adjustedFocusZoneProps}
Expand Down Expand Up @@ -574,7 +569,7 @@ export class ContextualMenuBase extends BaseComponent<IContextualMenuProps, ICon
const { contextualMenuItemAs: ChildrenRenderer = ContextualMenuItem } = this.props;

return (
<div className={this._classNames.header} style={item.style} role="heading" aria-level={this.props.title ? 2 : 1}>
<div className={this._classNames.header} style={item.style}>
<ChildrenRenderer
item={item}
classNames={classNames}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,13 @@ export class DialogContentBase extends BaseComponent<IDialogContentProps, {}> {
return (
<div className={classNames.content}>
<div className={classNames.header}>
<p className={classNames.title} id={titleId} role="heading">
<p className={classNames.title} id={titleId} role="heading" aria-level={2}>
{title}
</p>
<div className={classNames.topButton}>
{this.props.topButtonsProps!.map((props, index) => <IconButton key={props.uniqueId || index} {...props} />)}
{this.props.topButtonsProps!.map((props, index) => (
<IconButton key={props.uniqueId || index} {...props} />
))}
{(type === DialogType.close || (showCloseButton && type !== DialogType.largeHeader)) && (
<IconButton
className={classNames.button}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ exports[`Dialog renders Dialog correctly 1`] = `
}
>
<p
aria-level={2}
className=
ms-Dialog-title
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ export class Panel extends BaseComponent<IPanelProps, IPanelState> implements IP
className={css('ms-Panel-headerText', styles.headerText, headerClassName)}
id={headerTextId}
role="heading"
aria-level={2}
>
{headerText}
</p>
Expand Down