-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Accordion header buttons need aria-controls=panel-id #5750
Comments
Hi there @carmacleod! 👋 I wanted to clarify, does the accordion button require Thanks so much for taking the time to make this issue, btw! 🙏 |
Heh - everybody quotes Heydon's article when aria-controls comes up. I've quoted it myself. 😄 So, no, it's not required, but it is recommended for accordions. It gives screen readers the opportunity to take advantage of the relationship... although at present, I believe JAWS is the only one that does (they removed the very verbose keyboard help message that people objected to). However, longtime users of JAWS expect it to be there when they hear "expanded", and contrary to certain articles, it doesn't do any harm to have it there. The ARIA Working Group is going to be discussing Will Another question... about headings. Was planning to open a different issue about this, but I'll piggyback on this one. :) The APG recommends using So I was wondering how a component library would handle headings, because you don't know the information architecture of the page that the component will be used in, so you can't know which heading level to use... if any at all. Only the author using the component can know for sure whether or not headings are appropriate, and which level. You would almost need a prop called |
Totally fair @carmacleod! Will definitely make sure this gets updated. And agreed on the headings. I think we should add docs to show that folks can use headings with accordion instead of us needing to bake it into the component. I would be curious what you think of this example from Reach that documents this 🤔 |
Actually, adding docs to show how to use headings sounds like a good idea, assuming Carbon users have that flexibility? (Sorry to be asking such a simple question - I really need to carve out some time ⏲ to run through the Carbon tutorials so that I can create my own example pages instead of just React-ing ;) to pages my colleagues and others are creating...) |
Great question! Definitely don't apologize, love talking about all this stuff with you and taking in all the great knowledge you have to share 😄 I think it should be able to support that, or at the very least we should make it work such that this is the case. Another option was exploring using Let me know if you ever want to pair up some time and go through carbon! I would love to give ya a tour when you have free time 🎉 |
Wow, what a kind offer! That would be so awesome! Will DM for sure to figure out a good time! |
The accessibility documentation for the Carbon accordion says:
(nit: note that the sentence should say "an aria-controls property" and not "a aria-control property")
The issue is that there is no
aria-controls
property set on the accordion header buttons, and there should be. (react and vanilla)The text was updated successfully, but these errors were encountered: