Skip to content

Commit ccbd0b3

Browse files
Fix aria-required-parent and aria-required-children accessibility violations
1 parent 4c25252 commit ccbd0b3

File tree

4 files changed

+22
-17
lines changed

4 files changed

+22
-17
lines changed

dotcom-rendering/src/components/Masthead/Titlepiece/ExpandedNav/MoreSection.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ export const MoreSection = ({
160160
pillarDivider,
161161
pillarDividerExtended,
162162
]}
163-
role="none"
164163
>
165164
<ul css={columnLinks} role="menu" id={moreSectionId}>
166165
{links.map((link) => (

dotcom-rendering/src/components/Masthead/Titlepiece/ExpandedNav/Pillar.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ export const Pillar = ({
190190
!hasPageSkin && columnStyleFromLeftCol,
191191
pillarDivider,
192192
]}
193-
role="none"
194193
>
195194
{/*
196195
IMPORTANT NOTE: Supporting NoJS and accessibility is hard.

dotcom-rendering/src/components/Masthead/Titlepiece/ExpandedNav/SearchBar.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,11 @@ const searchSubmit = css`
9191
export const SearchBar = () => {
9292
const searchId = 'gu-search';
9393
return (
94-
<form css={searchBar} action="https://www.google.co.uk/search">
94+
<form
95+
css={searchBar}
96+
action="https://www.google.co.uk/search"
97+
role="search"
98+
>
9599
<TextInput
96100
hideLabel={true}
97101
label="Search input"

dotcom-rendering/src/components/Masthead/Titlepiece/ExpandedNav/Sections.tsx

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@ import {
1010
space,
1111
textSans17,
1212
} from '@guardian/source/foundations';
13-
import { Hide } from '@guardian/source/react-components';
1413
import type { EditionId } from '../../../../lib/edition';
1514
import { nestedOphanComponents } from '../../../../lib/ophan-helpers';
1615
import type { LinkType, NavType } from '../../../../model/extract-nav';
1716
import { palette as themePalette } from '../../../../palette';
18-
import { expandedNavLinkStyles, listAccessibility } from '../commonStyles';
17+
import {
18+
expandedNavLinkStyles,
19+
hideFromDesktop,
20+
listAccessibility,
21+
} from '../commonStyles';
1922
import { MoreSection } from './MoreSection';
2023
import { lineStyle, Pillar } from './Pillar';
2124
import { ReaderRevenueLinks } from './ReaderRevenueLinks';
@@ -111,7 +114,6 @@ export const Sections = ({ nav, editionId, hasPageSkin }: Props) => {
111114
return (
112115
<ul
113116
css={[columnsStyle, !hasPageSkin && columnsStyleFromLeftCol]}
114-
role="menubar"
115117
data-testid="nav-menu-columns"
116118
>
117119
{nav.pillars.map((column, i) => {
@@ -142,17 +144,17 @@ export const Sections = ({ nav, editionId, hasPageSkin }: Props) => {
142144
);
143145
})}
144146

145-
<Hide from="desktop">
146-
<li role="none">
147-
<SearchBar />
148-
</li>
149-
</Hide>
150-
<div css={lineStyle}></div>
147+
<li css={hideFromDesktop}>
148+
<SearchBar />
149+
</li>
150+
<li css={lineStyle}></li>
151151

152-
<ReaderRevenueLinks
153-
readerRevenueLinks={nav.readerRevenueLinks}
154-
editionId={editionId}
155-
/>
152+
<li>
153+
<ReaderRevenueLinks
154+
readerRevenueLinks={nav.readerRevenueLinks}
155+
editionId={editionId}
156+
/>
157+
</li>
156158

157159
{/* Mobile only Brand Extensions list */}
158160
<MoreSection
@@ -163,7 +165,7 @@ export const Sections = ({ nav, editionId, hasPageSkin }: Props) => {
163165
/>
164166

165167
{/* Desktop only Brand Extensions list*/}
166-
<li css={desktopBrandExtensionColumn} role="none">
168+
<li css={desktopBrandExtensionColumn}>
167169
<SearchBar />
168170

169171
<ul
@@ -177,6 +179,7 @@ export const Sections = ({ nav, editionId, hasPageSkin }: Props) => {
177179
<li
178180
css={brandExtensionListItem}
179181
key={brandExtension.title}
182+
role="none"
180183
>
181184
<a
182185
className="selectableMenuItem"

0 commit comments

Comments
 (0)