Skip to content

Commit 0e60f29

Browse files
committed
fix: update aria-label in SearchResults for improved accessibility
1 parent 62d4446 commit 0e60f29

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/components/search.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ const SearchResults = ({results, getItemProps, highlightedIndex}) => {
4444
as={LinkNoUnderline}
4545
to={item.path}
4646
active={highlightedIndex === index}
47-
aria-posinset={index + 1}
48-
aria-setsize={results.length}
47+
aria-label={`${item.title}${hierarchy.length ? ` in ${hierarchy.map(s => s.shortName || s.title).join(' / ')}` : ` in ${siteMetadata.shortName}`}, ${index + 1} of ${results.length}`}
4948
>
5049
<Box sx={{display: 'flex', flexDirection: 'column', flex: '0 0 auto'}}>
5150
<Text sx={{fontSize: 0}}>

0 commit comments

Comments
 (0)