-
Notifications
You must be signed in to change notification settings - Fork 90
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
aXe claims "severe" a11y error on conditional content blocks #455
Comments
The exact error message includes:
And the info page about this general error says:
I don't know why it says that. I checked the spec and couldn't find this property would not be allowed with certain roles. Did I miss anything? |
The rule they are applying seems to be the other way. As in not "this property isn't allowed" but "only properties that are allowed should be used". I'm not entirely certain if that makes sense, good chance aXe is wrong here. |
Also got this when trying to add automated accessibility testing with aXe. |
Asked the question of Deque on Twitter - @Detonite responded that the violation is because the spec doesn't allow it for input - cc @michaeldfallen @selfthinker |
Or particularly for role |
If you look at ARIA in HTML it states that for an
For menuitemradio (irrelevant in this case, but for completion’s sake) the spec states the following attributes are allowed:
So, I think the invalid ARIA doesn’t add anything in this case and can be removed. |
Thanks everyone, GOVUK. ShowHideContent is responsible for setting these ARIA attributes. I'll raise an issue over on the govuk_frontend_toolkit repo. |
I would challenge a) our user interaction of ticking a checkbox or radio box doing something (I presume there was lots of user research but just don't know any of that) and b) I would also challenge the spec. |
@selfthinker In case of checkbox I could see it be valid, since control can be indicated via For a radio control I don't see the point - since only one can be selected at any time, one cannot infer if deselecting collapses or expands a controlled element. In any case I'm not a fan of this type of content disclosure - especially in the case of radio controls, we cannot guarantee that the element being controlled is next in the tab order. |
Has this been found to cause problems for screen readers (rather than validators)? |
@jkva, I can see it making sense for radio buttons as well. When you select one, it opens something, then you select another and it closes the previous one and opens the next. Just like in our example on Elements. But it's probably less clear that way for screen readers. @fofr, I don't think anyone has reported that but it would be good to double check with a couple of screen readers. We have recently tested everything within Elements for accessibility issues and I don't think we found any issues with this interaction. But one way to fix it would be to move the |
The definition for aria-expanded states that the attribute can be used on elements with the following roles:
This means that aria-expanded can only be applied to the Nonetheless, some browsers expose the attribute and consequently some screen readers pick up that information and convey it to the user. This said, making a radio button the control for a disclosure widget is not a good design pattern from a UX point of view IMO. |
@LJWatson can you expand on why you don't think it's good to use a radio button for progressive disclosure? The progressive disclosure pattern is to only show relevant info or questions to users when we know it's relevant - based on their answer to another question. That question could take any form - checkbox, radio, etc, no? An example of using a radio for progressive disclosure is when we ask someone what country they live in on Register to vote. If they select 'outside the uk', we then show the question 'Where did you live before you moved to another country?'. |
It creates an interaction that will be unfamiliar and confusing to many. A set of radio buttons offers multiple choice, whereas a disclosure trigger offers a binary choice. extending one of the multiple choices to also be a binary choice overloads the interaction. There is also the problem that the aria-expanded attribute is not permitted on a radio button, and consequently it isn't widely supported by screen readers - adding further confusion to an already confusing pattern. |
We have tested this pattern many times in Register to vote and other services, and as far as I'm aware we've never seen an issue with it, in fact it's something we've seen test well - are you aware of any research to show it's confusing? |
Following the launch of the GOV.UK Design System, GOV.UK Elements will now only get major bug fixes and security patches. A similar issue has been noted for the GOV.UK Design System version of this component, so we will investigate the best way forwards there: alphagov/govuk-frontend#979 Thanks a lot for the input, I'm sure this thread will help us resolving this. 👍 |
Using the aXe a11y scanner on conditionally revealing content it reports:
Having tried through a screen reader and in another tool (pa11y) they don't report this as a problem.
You can replicate by installing either aXe for chrome or aXe for firefox and run it against the govuk-elements examples
Do you have any suggestions? Should we rework elements to not present this error? or propose the check be loosened in aXes ruleset?
The text was updated successfully, but these errors were encountered: