Skip to content

Commit 74335e4

Browse files
committed
fix: add aria-label to SearchResults items for improved accessibility
1 parent e5e0042 commit 74335e4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/components/search.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@ const SearchResults = ({results, getItemProps, highlightedIndex}) => {
4444
as={LinkNoUnderline}
4545
to={item.path}
4646
active={highlightedIndex === index}
47-
data-has-description="true"
48-
aria-label={`${item.title}${hierarchy.length ? ` in ${hierarchy.map(s => s.shortName || s.title).join(' / ')}` : ` in ${siteMetadata.shortName}`}, ${index + 1} of ${results.length}`}
4947
>
50-
<Box sx={{display: 'flex', flexDirection: 'column', flex: '0 0 auto'}}>
48+
<Box
49+
sx={{display: 'flex', flexDirection: 'column', flex: '0 0 auto'}}
50+
aria-label={`${item.title}${hierarchy.length ? ` in ${hierarchy.map(s => s.shortName || s.title).join(' / ')}` : ` in ${siteMetadata.shortName}`}, ${index + 1} of ${results.length}`}
51+
>
5152
<Text sx={{fontSize: 0}}>
5253
{hierarchy.length ? hierarchy.map(s => s.shortName || s.title).join(' / ') : siteMetadata.shortName}
5354
</Text>

0 commit comments

Comments
 (0)