-
Notifications
You must be signed in to change notification settings - Fork 4
chore: update AccordionItem to meet W3C standards #1075
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
base: develop
Are you sure you want to change the base?
Conversation
|
These modifications could have a big impact and cause a lot of breaking changes. This PR will be closed for now. |
ffffffelix
left a comment
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.
-
As all interactions should be at the button level, we also have to update our styling to reflect that. All states style (
:hover,:active,:focus-visible) should be on the button. Maybe we can refactor our CSS. -
I propose to simplify
data-testidlabel withaccordion-instead ofaccordion-item-as theAccordioncomponent is only a wrapper.
| aria-expanded={open} | ||
| {...onAccessibleClick({onClick: e => handleClick(e, open)})} | ||
| role="accordion-item" | ||
| data-testid="accordion-item" |
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.
- Maybe we don't need to add a
data-testidat this level, as there is no interaction or direct things to target - As ' aria-expanded` is at the button level, we should remove it from the heading.
- Same for
aria-controlsthat should be on the button. (W3C doc)
|
This PR will remain in draft until the next release, as the impact of the changes needs to be discussed with other teams. |
AccordionItem
headerwithh3elementrole="accordion-item"buttonelement aroundh3's contentdata-testid="accordion-button"tobuttonelementaria-expandedattribute tobuttonelementaria-controlsattribute tobuttonelementdata-testid="accordion-label"toTypographyelement