-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[Popover] role="presentation" causing accessibility issue when Popover is open #18106
Comments
@emilyuhde I think that we should ignore what CodeSniffer thinks is right or wrong (tools can be wrong). Do you have reference materials we can look at to dive into the issue? Thanks |
Thank you for opening this issue and filling out the template.
I was always suspicious of this usage since it's largely motivated by a lint rule that forbids event handlers on What's important here is to find out if a presentational parent with non-presentational children is actually problematic for assistive technology. While these tools are helpful (like lint rules) while authoring content they can be deceiving when consuming libraries that validate particular usage. |
In the unknown, I would tend to have more trust in a tool that has a look at the overall DOM output (CodeSniffer) rather than for a tool that performs static analysis (eslint). But, I think that it would be great to explore the problem deeper. |
I did some research and it seems like that the role is intended to remove implicit semantics. Considering the eslint rule itself recommends disabling the rule instead of using presentation I'd say we follow that recommendation. I'll do some testing with NVDA and Firefox if this introduces some false "clickable" announcement (something I really need to get clarification from NVDA folks). |
Per squizlabs/HTML_CodeSniffer#274, HTML Codesniffer has been updated so that it no longer complains about |
Thanks for the update. I'm going to close this then. @emilyuhde Thank you for reporting this even though it turned out to be a false positive. Still valuable information to know which tools our users use and how they use them. |
This is still an issue. I can't find elements with React Testing Library on screen when Backdrop from multiple Select is opened. |
Current Behavior 😯
When the Popover component is opened, the role is set to "presentation" which triggers a warning by HTML CodeSniffer that there is semantic meaning to elements under the element with role="presentation" so it's an inappropriate role to use.
"This element's role is "presentation" but contains child elements with semantic meaning."
Expected Behavior 🤔
The role used should not cause an accessibility error.
Steps to Reproduce 🕹
Steps:
Context 🔦
When doing accessibility testing on my component that's using Popover as its base, this error was being reported by HTML CodeSniffer. I tracked it down to it being an issue with the underlying MUI component as well.
Your Environment 🌎
The text was updated successfully, but these errors were encountered: