-
Notifications
You must be signed in to change notification settings - Fork 834
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
[EuiCollapsibleNavItem] Add a non-accordion group component #7315
[EuiCollapsibleNavItem] Add a non-accordion group component #7315
Conversation
unlike the other one we made previously, this one should only be used by `EuiCollapsibleNavItem` and is not a top-level export
- should theoretically help indicate to screen readers how many items are in each group
@1Copenut I'm so sorry to keep pinging you 🥲 But I'd really love your expert a11y opinion on the last commit in this PR! I'm not totally sure if adding the group/list/listitem roles is helpful to screen reader users, or if we should just leave them as free-floating content since there's already a |
Also FYI @sebelga and @tsullivan that this work is coming to Kibana in the next week or so |
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.
@cee-chen I ran this through VoiceOver + Safari after dinner on Oct 25 (Wednesday) and here's what I found:
- The list items are announcing themselves as list items, and their index in the list, but there's a region sitting between the
div[role="list"]
andelem[role="listitem"]
in several cases that was causing a small level of confusion. I'd have gone ahead and tested with NVDA and JAWS, but for point two. - This structure with elements between the
list
andlistItem
roles was throwing critical errors in axe-core. That'll give us grief in automated tests as well as the reduced experience for assistive technology.
I agree with the reasoning you've applied here; thank you for taking a run at it. I'd like to keep this general structure, but it'll have to be refactored to simpler markup to pass validation and honor the roles you've assigned.
Feel free to holler at me in the morning if you want to discuss ways this could be refactored or if it's work there's time and energy to take on.
This is #7316 FWIW, and would be fixed by removing that role from our EuiAccordion component
This is weird because I tried moving the It sounds like this may not be a clear win, so I'm going to take a revert the commit in this PR for now (so Kibana still gets the new API earlier) and open up a separate draft PR just for screen reader list behavior. |
This reverts commit 95654e7.
Preview staging links for this PR:
|
💚 Build Succeeded
History
|
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! This feels like the best approach given the difficulty refactoring for lists and list items just now. I tested with VO, NVDA, and JAWS in their preferred browsers. All elements were announced in order and hierarchy maintained.
I think there's a future opportunity for lists and list items, but it'll be a bigger refactor as we've seen and probably a big effort.
Summary
Screenshots:
Kibana is currently doing mildly hacky shenanigans to accomplish the above (using the accordion component and forcibly hiding the arrow via CSS).
Instantiating an accordion when one isn't needed is a lot of extra unnecessary logic, and is also potentially an accessibility issue. So I've added an
isCollapsible
API next to theitems
array that can be used to conditionally not render an accordion but instead what's essentially a plain div. Visually, it should look the same as an open accordion with no arrow, but semantically it's different to screen readers, and a lot more lightweight.I strongly recommend following along by commit and hiding white space changes.
The last commit touches a lot of files but is technically optional - I wanted to see what would happened if I tried adding the group, list, and listitem roles to try adding more meaningful information/relationships between groups and group headings.(reverted)QA
General checklist
and cypress tests