-
Notifications
You must be signed in to change notification settings - Fork 787
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
aria-activedescendent="" - what problem does this cause? #179
Comments
Hi @jnurthen. Did you consider the scenario in which an AT users is reading though the page without shifting focus? Instructing NVDA for example to read from a given point on the page will not move focus automatically to elements it is reading. |
Yes I have considered it. When the element does not have focus aria-activedescendent is not relevant. It is defined as being the currently active descendent of a composite widget. When the widget it not focussed there is no active descendent so the property is irrelevant. It is not used when computing a value or selection for a widget (or at least it shouldn't be). In any case, if this continues to give errors, the solution is to remove the attribute - which would clear the error, when there is no focus. I don't see how this would help any user and simply creates additional work for developers. |
From the spec: The "undefined" value, when allowed on a state or property, is an explicit indication that the state or property is not set. The value is used on states and properties that support tokens, and the "undefined" value is a string that is one of the allowed tokens. It is also used on some states and properties that accept true/false values, when "undefined" has a different meaning than "false". Based on that language, I would say that having an empty value for aria-activedescendent is therefore invalid, since it requires an ID and isn't a token or a true/false situation. Here are some solutions to consider:
I hope this helps! |
I agree that according to the spec as written it is not allowed - although the spec does make it clear in the text that aria-activedescendent is only relevant when the component has DOM focus. Its value is irrelevant when the component does not have focus. I don't want to take up developer's time fixing issues which have no accessibility impact. Their time is better spent in other places. I will log a bug against the ARIA spec to resolve it there. |
Logged w3c/aria#501 |
@jnurthen are you suggesting one of the following?
I would be in favor of doing the second one because it would allow for useful testing of the end state of a bunch of focus behavior once whereas the first option would require calls to aXe sequentially for every element that could receive focus, or it would require us to set focus on each element that could receive it, before testing it (which has its own conditional usefulness/reliability issues). Also, for context: are you using the extension or the API or both? |
@dylanb The 2nd sounds reasonable. Although I think it is potentially only a warning, not an error, for elements which aren't focused even if there is an invalid idref. I can see scenarios on combo boxes / autocomplete where the child elements get removed from the DOM once the list gets closed but the code doesn't clean up the invalid idref on the parent aria-activedescendant. Again - it would be better to clean it up - but I don't see what accessibility issue it would actually cause so long as everything gets reset once it gets focus again. I really don't think aXe moving focus around the page is a good idea. I'm normally using the extension. |
I'm going to resolve this issue with #1007. @dylanb I'm not a fan of your suggestion to test that |
@WilcoFiers The APG combobox examples have empty From Chrome DevTools Console:
[Edit: Never mind - this comment in the ARIA spec issue says it's ok... sorry about that!] |
Looks like that ARIA practices combox example has moved here for anyone reading this. |
In a few of our frameworks aria-activedescendent is set to "" until the component takes focus. Once it gets focused then it gets set correctly to a valid idref.
I'm not sure from the spec whether an empty string is valid or not for aria-activedescendent, but I really don't think this causes an accessibility issue.
Any chance this error can be suppressed for aria-activedescendent unless the component actually has focus - when it of course needs to be valid.
The text was updated successfully, but these errors were encountered: