Skip to content

Commit c3be0c3

Browse files
committed
Added null check for aria labels
1 parent 2b62cbc commit c3be0c3

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Diff for: src/components/components/club-teaser-list/club-teaser-list.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ export const ClubTeaser = props => {
3434
/>
3535
</div>
3636
<div className="club-teaser__text">
37-
<h2 className="club-teaser__title" id={title.replace(/\s/g, "")}>
37+
<h2
38+
className="club-teaser__title"
39+
id={(title || "").replace(/\s/g, "")}
40+
>
3841
{title}
3942
</h2>
4043
<span className="club-teaser__description"> {subtitle} </span>

Diff for: src/components/components/faq-group/faq-group.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@ export default props => {
1313
<div className={classes}>
1414
<ShadowBox>
1515
<div className="faq__group-header">
16-
<h2 title="title title--x-small" id={props.header.replace(/\s/g, "")}>
16+
<h2
17+
title="title title--x-small"
18+
id={(props.header || "").replace(/\s/g, "")}
19+
>
1720
{props.header}
1821
</h2>
1922
</div>
2023
<ul
2124
className="faq__group-content"
22-
aria-labelledby={props.header.replace(/\s/g, "")}
25+
aria-labelledby={(props.header || "").replace(/\s/g, "")}
2326
>
2427
{props.children}
2528
</ul>

0 commit comments

Comments
 (0)