-
Notifications
You must be signed in to change notification settings - Fork 38
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
Make sure IDs on collapsible navigation are unique #160
Conversation
Looks like there's some issues with the format of the JavaScript as StandardJs is throwing errors. I will check this out but seems sensible so far, thanks :) |
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've tested this out locally seems to work as expected :)
Needs a CHANGELOG entry and linting fixes then we can get it merged.
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.
Hmm actually this seems to break the relationship between aria-controls on the button and the expanded element. 🤔
aabbd43
to
a9270b8
Compare
Multiple nested pages were getting assigned the same ID (from the parent). This change appends the iterator index to the elements to make sure they're unique. Also added a extra nested page to the example docs and a test.
a9270b8
to
c186288
Compare
@NickColley I have amended the the logic in 41c0956 ... the other option was to wrap the headings in a single element for aria purposes, thought this was easier. Let me know what you think. |
I imagine from a real world point of view having a single expanded area would be easier to use. I suspect having multiple places being controlled may behave in a weird way in screen readers even though it's allowed by the aria specification. |
Maybe worth giving this a test in a screen reader before making a decision? It may work great with multiple IDs. |
41c0956
to
8d229a4
Compare
When using multiple nested unique IDs the aria relationship broke. This change adds the list of the nested elements in the `aria-controls` attribute.
8d229a4
to
511d1ce
Compare
From what I can see, *I don't have the capacity to be testing this with JAWS right now |
I think with that in mind we should get this in and consider raising an issue to improve it in the future. |
Multiple nested pages were getting assigned the same ID (from the parent). This change
appends the iterator index to the elements to make sure they're unique.
Also added an extra nested page to the example docs and a test.