-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fix(button): set aria-pressed to props.isSelected for icon-only ghost #7900
fix(button): set aria-pressed to props.isSelected for icon-only ghost #7900
Conversation
Deploy preview for carbon-elements ready! Built with commit 89a00e9 |
Deploy preview for carbon-components-react ready! Built without sensitive environment variables with commit 89a00e9 https://deploy-preview-7900--carbon-components-react.netlify.app |
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.
looks good to me
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.
LGTM 👍 ✅
Related #7757, #7784
Following the WAI-ARIA Authoring Practices for toggle buttons, this PR sets the button's
aria-pressed
attribute according toprops.isSelected
(if it is icon-only and ghost).Changelog
New
aria-pressed
attribute to button icon-only ghost buttons to reflectprops.isSelected
Changed
Testing / Reviewing
props.isSelected
is not passed, the button should not have thearia-pressed
attribute.props.isSelected = false
is passed, the button should havearia-pressed="false"
props.isSelected = true
is passed, the button should havearia-pressed="true"
props.isSelected = true
is passed but the button is not icon-only and ghost, the butto should not have thearia-pressed
attribute