Skip to content

Commit 181f12e

Browse files
fix(LabelGroup): add role and aria-label to hidden items overlay (#7241)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 8e66a2c commit 181f12e

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

.changeset/four-carrots-divide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/react": patch
3+
---
4+
5+
fix(LabelGroup): add role and aria-label to hidden items overlay

packages/react/src/LabelGroup/LabelGroup.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ const OverlayToggle: React.FC<
7070
openOverflowOverlay,
7171
overlayPaddingPx,
7272
overlayWidth,
73+
totalLength,
7374
}) =>
7475
hiddenItemIds.length ? (
7576
<AnchoredOverlay
@@ -91,6 +92,7 @@ const OverlayToggle: React.FC<
9192
</Button>
9293
)}
9394
focusZoneSettings={{disabled: true}}
95+
overlayProps={{role: 'dialog', 'aria-label': `All ${totalLength} labels`, 'aria-modal': true}}
9496
>
9597
<div className={classes.OverlayContainer} style={{width: overlayWidth, padding: `${overlayPaddingPx}px`}}>
9698
<div className={classes.OverlayInner}>{children}</div>

0 commit comments

Comments
 (0)