-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ACS] - Add accessibility to snackbar #858
Conversation
<IconButtonWrapper | ||
role="button" | ||
onClick={onClose} | ||
aria-label={ariaLabelClose} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this element to be considered interactive, it would be necessary to add tabindex="0" and listen for "Enter" or "space" to trigger the onClose
, this is done automatically if you change the element's tag to button
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point! changed accordingly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could change the styled-component tag to simplify.
An element that has the button
tag already has the role button
implicitly.
-const IconButtonWrapper = styled.div`
+const IconButtonWrapper = styled.button`
<IconButtonWrapper
- role="button"
onClick={onClose}
aria-label={ariaLabelClose}
- as="button"
>
Quality Gate passedIssues Measures |
<IconButtonWrapper | ||
role="button" | ||
onClick={onClose} | ||
aria-label={ariaLabelClose} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could change the styled-component tag to simplify.
An element that has the button
tag already has the role button
implicitly.
-const IconButtonWrapper = styled.div`
+const IconButtonWrapper = styled.button`
<IconButtonWrapper
- role="button"
onClick={onClose}
aria-label={ariaLabelClose}
- as="button"
>
alignItems="center" | ||
mr="small" | ||
role="img" | ||
data-testid="img" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using a string directly here, use it via props
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what should be added as a prop, the data-testid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this way we avoid possible problems with testing
color: inherit; | ||
border: none; | ||
padding: 0; | ||
outline: inherit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these style changes have a visual impact? If so, could you include some screen shots so we can visualize the changes, please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it does not, they are added so that it won't affect the visuals. Since it was converted to a button
Description 📄
Platforms 📲
Type of change 🔍
How Has This Been Tested? 🧪
Checklist: 🔍
Screenshots 📸
[Upload your screenshots here]