Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/edit-site/src/components/page-patterns/grid-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,12 @@ export default function GridItem( { categoryId, composite, icon, item } ) {
aria-label={ item.title }
aria-describedby={
ariaDescriptions.length
? ariaDescriptions.join( ' ' )
? ariaDescriptions
.map(
( _, index ) =>
`${ descriptionId }-${ index }`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: ${ descriptionId }-${ index } is used one more time, a few lines below, and could be set to a variable.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two uses of ${ descriptionId }-${ index } are in separate loops so I'm not sure they can be extracted to a shared variable.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. Aside: I'm not even sure why there is the need to push the notifications/IDs to an array. Is there any case where a pattern can have more than one description?

)
.join( ' ' )
: undefined
}
>
Expand Down