From 7a37b1d535e6ff41827d588afc4277d6d80f1886 Mon Sep 17 00:00:00 2001 From: Dallas Date: Fri, 14 Oct 2022 10:22:42 -0500 Subject: [PATCH] fix(Nav): horizontalsubnav aria label default to Local (#8213) * fix(Nav): make aria label for horizontalsubnav default to Local * update test snap * update example custom aria labels as per pr comments --- packages/react-core/src/components/Nav/Nav.tsx | 2 +- .../components/Nav/__tests__/__snapshots__/Nav.test.tsx.snap | 2 +- packages/react-core/src/components/Nav/examples/NavDefault.tsx | 2 +- .../react-core/src/components/Nav/examples/NavDrilldown.tsx | 2 +- .../react-core/src/components/Nav/examples/NavExpandable.tsx | 2 +- .../src/components/Nav/examples/NavExpandableThirdLevel.tsx | 2 +- packages/react-core/src/components/Nav/examples/NavFlyout.tsx | 2 +- packages/react-core/src/components/Nav/examples/NavGrouped.tsx | 2 +- .../src/components/Nav/examples/NavHorizontalPageHeader.tsx | 2 +- .../src/components/Nav/examples/NavHorizontalSubNav.tsx | 2 +- .../src/components/Nav/examples/NavLegacyTertiary.tsx | 2 +- packages/react-core/src/components/Nav/examples/NavMixed.tsx | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/react-core/src/components/Nav/Nav.tsx b/packages/react-core/src/components/Nav/Nav.tsx index 9be8164f521..974aef08f0f 100644 --- a/packages/react-core/src/components/Nav/Nav.tsx +++ b/packages/react-core/src/components/Nav/Nav.tsx @@ -163,7 +163,7 @@ export class Nav extends React.Component< this.state.isScrollable && styles.modifiers.scrollable, className )} - aria-label={ariaLabel || (variant === 'tertiary' ? 'Local' : 'Global')} + aria-label={ariaLabel || (['tertiary', 'horizontal-subnav'].includes(variant) ? 'Local' : 'Global')} {...getOUIAProps(Nav.displayName, ouiaId !== undefined ? ouiaId : this.state.ouiaStateId, ouiaSafe)} {...props} > diff --git a/packages/react-core/src/components/Nav/__tests__/__snapshots__/Nav.test.tsx.snap b/packages/react-core/src/components/Nav/__tests__/__snapshots__/Nav.test.tsx.snap index 869d7955e38..b33f9166be1 100644 --- a/packages/react-core/src/components/Nav/__tests__/__snapshots__/Nav.test.tsx.snap +++ b/packages/react-core/src/components/Nav/__tests__/__snapshots__/Nav.test.tsx.snap @@ -664,7 +664,7 @@ exports[`Nav Horizontal Nav List 1`] = ` exports[`Nav Horizontal SubNav List 1`] = `