Skip to content

Commit 62155a6

Browse files
authored
[Chat] Added Aria Roles to Attachment Components (#4731)
1 parent e6a83b3 commit 62155a6

5 files changed

Lines changed: 26 additions & 3 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "fix",
4+
"workstream": "File Sharing",
5+
"comment": "Added Aria Roles for A11y",
6+
"packageName": "@azure/communication-react",
7+
"email": "109105353+jpeng-ms@users.noreply.github.com",
8+
"dependentChangeType": "patch"
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "fix",
4+
"workstream": "File Sharing",
5+
"comment": "Added Aria Roles for A11y",
6+
"packageName": "@azure/communication-react",
7+
"email": "109105353+jpeng-ms@users.noreply.github.com",
8+
"dependentChangeType": "patch"
9+
}

packages/react-components/src/components/Attachment/AttachmentCard.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ const MappedMenuItems = (
187187
<TooltipHost content={menuActions[0].name}>
188188
<ToolbarButton
189189
aria-label={menuActions[0].name}
190+
role="button"
190191
icon={menuActions[0].icon}
191192
onClick={() => {
192193
try {
@@ -203,14 +204,17 @@ const MappedMenuItems = (
203204
<TooltipHost content={localeStrings.attachmentMoreMenu}>
204205
<MenuTrigger>
205206
<ToolbarButton
206-
icon={<Icon iconName="AttachmentMoreMenu" aria-label={localeStrings.attachmentMoreMenu} />}
207+
aria-label={localeStrings.attachmentMoreMenu}
208+
role="button"
209+
icon={<Icon iconName="AttachmentMoreMenu" />}
207210
/>
208211
</MenuTrigger>
209212
</TooltipHost>
210213
<MenuPopover>
211214
<MenuList>
212215
{menuActions.map((menuItem, index) => (
213216
<MenuItem
217+
aria-label={menuItem.name}
214218
key={index}
215219
icon={menuItem.icon}
216220
onClick={async () => {

packages/react-components/src/components/Attachment/AttachmentCardGroup.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export const _AttachmentCardGroup = (props: _AttachmentCardGroupProps): JSX.Elem
5757
attachmentGroupLayout === _AttachmentCardGroupLayout.Grid ? attachmentCardGirdLayout : attachmentCardFlexLayout
5858
)}
5959
aria-label={ariaLabel}
60+
role="list"
6061
>
6162
{children}
6263
</Stack>

packages/react-components/src/components/Attachment/AttachmentUploadCards.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ export const _AttachmentUploadCards = (props: AttachmentUploadCardsProps): JSX.E
7777
key={attachment.id}
7878
menuActions={[
7979
{
80-
name: props.strings?.removeAttachment ?? 'Remove',
80+
name: removeAttachmentButtonString(),
8181
icon: (
82-
<div aria-label={removeAttachmentButtonString()} data-testid="attachment-upload-card-remove">
82+
<div data-testid="attachment-upload-card-remove">
8383
<Icon iconName="CancelAttachmentUpload" className={mergeStyles(actionIconStyle)} />
8484
</div>
8585
),

0 commit comments

Comments
 (0)