Skip to content

Commit

Permalink
fix(forms): ensure Message validation icon has a role of "img" (#1888)
Browse files Browse the repository at this point in the history
  • Loading branch information
jzempel authored Aug 15, 2024
1 parent 052c7cd commit cf568a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/forms/src/elements/common/Message.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ describe('Message', () => {

expect(getByText(text).firstChild!.nodeName).toBe('svg');
expect(getByText(text).firstChild).toHaveAttribute('aria-label', validationLabel);
expect(getByText(text).firstChild).toHaveAttribute('role', 'img');
});
});
});
3 changes: 2 additions & 1 deletion packages/forms/src/styled/common/StyledMessageIcon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ interface IStyledMessageIconProps {
export const StyledMessageIcon = styled(MessageIcon).attrs({
'data-garden-id': COMPONENT_ID,
'data-garden-version': PACKAGE_VERSION,
'aria-hidden': null
'aria-hidden': null,
role: 'img'
})<IStyledMessageIconProps>`
width: ${props => props.theme.iconSizes.md};
height: ${props => props.theme.iconSizes.md};
Expand Down

0 comments on commit cf568a7

Please sign in to comment.