Merge pull request #11232 from bridgetbarnes/catalog-entities-MoreVert-aria-label

Fix invalid aria- attribute
This commit is contained in:
Ben Lambert
2022-05-03 09:59:37 +02:00
committed by GitHub
2 changed files with 9 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog': patch
---
Lighthouse was reporting this button as having invalid aria- values, as the popover doesn't exist until clicked. This adds additional labels to the button to make it valid aria
@@ -109,9 +109,12 @@ export function EntityContextMenu(props: EntityContextMenuProps) {
aria-label="more"
aria-controls="long-menu"
aria-haspopup="true"
aria-expanded={!!anchorEl}
role="button"
onClick={onOpen}
data-testid="menu-button"
className={classes.button}
id="long-menu"
>
<MoreVert />
</IconButton>
@@ -121,6 +124,7 @@ export function EntityContextMenu(props: EntityContextMenuProps) {
anchorEl={anchorEl}
anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}
transformOrigin={{ vertical: 'top', horizontal: 'right' }}
aria-labelledby="long-menu"
>
<MenuList>
{extraItems}