Skip to content

Commit a4d0dd1

Browse files
committed
BOLT-327 Rename ariaLabelledBy
1 parent ab0f220 commit a4d0dd1

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

packages/dotcom-ui-header/src/components/sub-navigation/SubNavDropdown.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ interface DropdownItem {
99
interface SubNavDropdownProps {
1010
id: string
1111
items: DropdownItem[]
12-
labelledById: string
12+
ariaLabelledBy: string
1313
title?: string
1414
}
1515

16-
const SubNavDropdown: React.FC<SubNavDropdownProps> = ({ id, items, labelledById, title }) => {
16+
const SubNavDropdown: React.FC<SubNavDropdownProps> = ({ id, items, ariaLabelledBy, title }) => {
1717
return (
1818
<div
1919
id={id}
2020
className="o-header__subnav-dropdown"
2121
data-o-header-subnav-dropdown-modal
2222
role="dialog"
2323
aria-modal="true"
24-
aria-labelledby={labelledById}
24+
aria-labelledby={ariaLabelledBy}
2525
>
2626
{title && <h2 className="o-header__subnav-dropdown-title">{title}</h2>}
2727
<button

packages/dotcom-ui-header/src/components/sub-navigation/SubNavWithDropdown.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface SubNavWithDropdownProps {
1010

1111
const SubNavWithDropdown: React.FC<SubNavWithDropdownProps> = ({ item, selected }) => {
1212
const dropdownItems = item.subnavDropdownOptions || []
13-
const labelSlug = item.label.toLowerCase().replace(/\s+/g, '-')
13+
const labelSlug = item.label?.toLowerCase().replace(/\s+/g, '-')
1414
const buttonId = `subnav-dropdown-button-${labelSlug}`
1515
const modalId = `subnav-dropdown-modal-${labelSlug}`
1616

@@ -29,7 +29,7 @@ const SubNavWithDropdown: React.FC<SubNavWithDropdownProps> = ({ item, selected
2929
>
3030
{item.label}
3131
</button>
32-
<SubNavDropdown id={modalId} labelledById={buttonId} items={dropdownItems} title={item.label} />
32+
<SubNavDropdown id={modalId} ariaLabelledBy={buttonId} items={dropdownItems} title={item.label} />
3333
</div>
3434
)
3535
}

0 commit comments

Comments
 (0)