File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,19 +9,19 @@ interface DropdownItem {
99interface 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
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ interface SubNavWithDropdownProps {
1010
1111const 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}
You can’t perform that action at this time.
0 commit comments