From d5129e5fc07dc03088d8ba9562860f1d32766b86 Mon Sep 17 00:00:00 2001 From: Micah Godbolt Date: Fri, 10 Aug 2018 03:03:18 +0530 Subject: [PATCH] Added consistent aria levels to any role='heading' (#5782) * Removed heading role from combo and contextualmenus, updated dialog and panel with aria-level 2 * Changefile --- .../update-aria-level_2018-08-02-22-33.json | 11 +++++++++++ .../src/components/ComboBox/ComboBox.tsx | 2 +- .../components/ContextualMenu/ContextualMenu.base.tsx | 9 ++------- .../src/components/Dialog/DialogContent.base.tsx | 6 ++++-- .../Dialog/__snapshots__/Dialog.test.tsx.snap | 1 + .../src/components/Panel/Panel.tsx | 1 + 6 files changed, 20 insertions(+), 10 deletions(-) create mode 100644 common/changes/office-ui-fabric-react/update-aria-level_2018-08-02-22-33.json diff --git a/common/changes/office-ui-fabric-react/update-aria-level_2018-08-02-22-33.json b/common/changes/office-ui-fabric-react/update-aria-level_2018-08-02-22-33.json new file mode 100644 index 0000000000000..be8904b0b01d2 --- /dev/null +++ b/common/changes/office-ui-fabric-react/update-aria-level_2018-08-02-22-33.json @@ -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": "mgodbolt@microsoft.com" +} \ No newline at end of file diff --git a/packages/office-ui-fabric-react/src/components/ComboBox/ComboBox.tsx b/packages/office-ui-fabric-react/src/components/ComboBox/ComboBox.tsx index df5af5e16d53d..c51393acbf09a 100644 --- a/packages/office-ui-fabric-react/src/components/ComboBox/ComboBox.tsx +++ b/packages/office-ui-fabric-react/src/components/ComboBox/ComboBox.tsx @@ -1120,7 +1120,7 @@ export class ComboBox extends BaseComponent { const { onRenderOption = this._onRenderOptionContent } = this.props; return ( -
+
{onRenderOption(item, this._onRenderOptionContent)}
); diff --git a/packages/office-ui-fabric-react/src/components/ContextualMenu/ContextualMenu.base.tsx b/packages/office-ui-fabric-react/src/components/ContextualMenu/ContextualMenu.base.tsx index 5436717a54698..40576ef788cdc 100644 --- a/packages/office-ui-fabric-react/src/components/ContextualMenu/ContextualMenu.base.tsx +++ b/packages/office-ui-fabric-react/src/components/ContextualMenu/ContextualMenu.base.tsx @@ -302,12 +302,7 @@ export class ContextualMenuBase extends BaseComponent - {title && ( -
- {' '} - {title}{' '} -
- )} + {title &&
{title}
} {items && items.length ? ( +
{ return (
-

+

{title}

- {this.props.topButtonsProps!.map((props, index) => )} + {this.props.topButtonsProps!.map((props, index) => ( + + ))} {(type === DialogType.close || (showCloseButton && type !== DialogType.largeHeader)) && (

implements IP className={css('ms-Panel-headerText', styles.headerText, headerClassName)} id={headerTextId} role="heading" + aria-level={2} > {headerText}