Fix accessibility issue: StepConnector is invalid in list#48397
Fix accessibility issue: StepConnector is invalid in list#48397ArmandRedgate wants to merge 3 commits intomui:masterfrom
StepConnector is invalid in list#48397Conversation
Deploy previewhttps://deploy-preview-48397--material-ui.netlify.app/ Bundle size
Check out the code infra dashboard for more information about this PR. |
2d1f784 to
0c24946
Compare
0c24946 to
446c407
Compare
|
Thanks for the PR! Not sure this fixes the problem of incorrect markup. I would suggest doing something different, like changing the markup from @mj12albert @siriwatknp any thoughts? |
Hmmm.. I'm not sure there's any benefit in screen reader users even needing to see these connectors, as they are purely visual indicators of a step-by-step association. It should be enough to exclude them from inspection by screen readers. They especially shouldn't be read as list items, as otherwise screen readers may give incorrect list length when read out. The
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/separator_role We could change the element to To me hiding these elements from the accessibility tree as purely visual elements seems like the best course of action. |
That makes sense. This is my first PR so I'm not sure how best to write those. Feel free to add some yourself or point me to some examples and I'll add them 🙂 |
StepConnector is invalid in list
|
The error is about incorrect markup, so we need to address that. We either use |
|
Ok, I've tried
The reason this is is probably due to this line:
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/presentation_role So using role="presentation" effectively switches a tag to a Like I said, switching it to a
Scanners seem to be happy with the latter, so I would posit that is the right solution. |
I am favor this solution, looks straight forward and sounds most correct with HTML defaults |
Not |
|
@ArmandRedgate why is the role separator seems to be ok, not sure why you said it's between groups of unrelated elements. To me it's saying it groups related content and items. As for the horizontal part, that's not true either, as we can use |
|
#48492 FYI @ArmandRedgate |


(This is my first PR here so please bear with me)
Why?
Originally raised in this comment
The goal here is to fix accessibility errors around
StepConnectorsas a follow-up to #47687. Namely,StepConnectorsaredivs, which are not permitted as children toolelements.What?
aria-hiddentoStepConnectorsTesting
I have tested this fix by checking the docs site both before and after the change and finding that the accessibility error is now fixed.
Before
After