Skip to content

Commit 0ad1448

Browse files
authored
Update nav for accessibility (github#39376)
1 parent f317575 commit 0ad1448

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

components/sidebar/SidebarNav.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ export const SidebarNav = ({ variant = 'full' }: Props) => {
2525
style={{ width: 326, height: 'calc(100vh - 65px)', top: '65px' }}
2626
>
2727
{variant === 'full' && currentProduct && (
28-
<div className={cx('d-none px-4 pb-3 border-bottom d-xl-block')}>
28+
<nav
29+
className={cx('d-none px-4 pb-3 border-bottom d-xl-block')}
30+
aria-labelledby={currentProduct.name}
31+
>
2932
<AllProductsLink />
3033
{currentProduct && (
3134
<div className="mt-3">
@@ -41,7 +44,7 @@ export const SidebarNav = ({ variant = 'full' }: Props) => {
4144
</div>
4245
)}
4346
{variant === 'full' && isRestPage && <ApiVersionPicker />}
44-
</div>
47+
</nav>
4548
)}
4649
<div
4750
className={cx(
@@ -51,13 +54,11 @@ export const SidebarNav = ({ variant = 'full' }: Props) => {
5154
style={{ width: 326, height: 'calc(100vh - 175px)', paddingBottom: sidebarPaddingBottom }}
5255
role="banner"
5356
>
54-
<nav aria-labelledby="title-h1">
55-
{!currentProduct || currentProduct.id === 'search' ? (
56-
<SidebarHomepage />
57-
) : (
58-
<SidebarProduct />
59-
)}
60-
</nav>
57+
{!currentProduct || currentProduct.id === 'search' ? (
58+
<SidebarHomepage />
59+
) : (
60+
<SidebarProduct />
61+
)}
6162
</div>
6263
</div>
6364
)

0 commit comments

Comments
 (0)