-
Notifications
You must be signed in to change notification settings - Fork 125
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-hidden error case: remove attribute aria-hidden=true on elements that become focused, and any ancestor of the element that is currently focused. #1255
Comments
See also #1254 |
@asurkov, do you agree? |
Question 1: When you say ancestor elements, do you mean we would only expose the ancestor chain (not siblings of any ancestors along that chain) or the entire tree up to the top-most ancestor? For example:
Does "b" get exposed? Based on the suggestion of removing aria-hidden from the DOM, I'm guessing the answer is yes, which is good... but that needs to be made super clear. If the answer is no, I have big problems with this; see #1185 (comment). Question 2: If the element loses focus, do we hide it again? Again, based on the DOM mutation suggestion, I'm guessing no, which is good... but again, if the answer is yes, I have a problem with this, since we'd be constantly rebuilding and throwing away parts of the tree. Question 3: What about the Google Groups case (maybe this is gone now?) where we have something like:
(where the input is visually hidden) My understanding is that this was one of the reasons Google was originally pushing for hidden/presentational focusable content to be unconditionally pruned from the tree. Screen readers even had to make changes to handle that case correctly. |
@jcsteh |
Chime in from Microsoft here, I'm not supportive of this runtime behavior overriding aria-hidden. It will be a nightmare to debug. I'm more in favor of simplifying aria-hidden more and to make it more predictable, even at the expense of some existing content visibility :) |
@vicfei-ms please suggest an alternative solution to the "401k problem". This is the problem where users are not able to access extremely important pages that misuse aria-hidden, and there are no workarounds available. |
@aleventhal |
@vicfei-ms No one has a perfect solution ... Would you be willing to write up your proposal so we can compare the pros and cons? :) |
@vicfei-ms Can you please enumerate a valid use case that this proposal would then render invalid since you indicated: "... hurts authors that legitimately use the property and would be confused trying to debug why something is not working" That pasted clause implies a valid use case being now rendered "not working". Please present one or an alternative solution to help us understand what valid use case we would make more difficult to debug? It is my assertion that it is never appropriate for a focussed item to have aria-hidden=true on it, full stop. |
@jcsteh do @aleventhal's answers to your questions address your remaining concerns on this issue? |
Yes, except for one thing:
My understanding of the Google Groups case was that it was focusing the (hacky) input, but the intention was that because the input was aria-hidden, focus would land on the role="button" ancestor. That would break with this proposal. Personally, I always thought this was a terrible implementation anyway, but I know it was something Google was doing in the wild, so I thought it worth raising. I'm not sure if this is still being done in the wild. |
That is a pretty clear authoring violation, though, right? We can't improve anything, full stop, ever in the future of the universe, if we are binding ourselves both by good previous code and bad previous code. It's actually mathematically impossible to proceed at that point, as it covers the entire set of possible code, so am I missing something, or are we basically good to go on this issue? Also @aleventhal perhaps you can poke the appropriate internal teams to resolve that use case; thereby completely addressing it? |
According to the current spec, I'm not sure it is. I don't see anything in the current spec which explicitly prohibits aria-hidden on a focusable element. And therein lies a backwards compatibility problem: we're breaking things that were acceptable - they weren't violations- according to the existing spec. |
Ok, fine, let me ask it differently. We have tons of bad things that happen when aria-hidden="true" is used on a focusable element. Can you list a single bad thing that occurs if it is disallowed now? I hear you, but specs are written by humans. Humans make mistakes. All we can do is fix it going forward. We must fix this, right? |
As I said, this has occurred in the wild on Google Groups, which is hardly
an obscure site nobody uses. If it breaks Google Groups (and I'm not sure
if it does any more), then yes, this is a bad thing. And if Google Groups
has done it, how many other sites have done it? I'm not talking about some
invented test case here. I raised the concern. If you want to dismiss it,
fine - I already expressed that I think it's an awful use case anyway - but
let's at least be clear about what we're potentially breaking.
|
Where is this Google Groups aria-hidden input? 🤮 |
I vaguely recall this was Google Groups, but it seems it might have actually been the Google Apps Control Panel and role="presentation", not aria-hidden. Similar issue, but separate to this. See nvaccess/nvda#3781. However, I went back through my email archives and I did find a conversation with Google engineers in 2014 about Google Sheets. Back then (when braille mode didn't exist), in Google Sheets, when focused in the spreadsheet (but not
So, I think it might be worth bringing Dominic (@minorninth) in on this one. |
By the above I mean consider a simple case like the following: |
Regarding the 401k problem and the separate example you gave me, where ATs expect to announce content in role="dialog". Here are my thoughts, but may be far fetched:
|
@vicfei-ms you said: That should never happen, full stop. That button does not also have tabindex=-1, so it will result in exactly the problem we are trying to prevent. That is not a valid use case. That is an invalid use case that I have absolutely no problem breaking. At least you'll know, as a screen reader user, what you've landed on, instead of landing on "blank" and having no recourse what-so-ever. |
I think this is a great idea, provided that this is done:
In fact, I think it would be great if browsers did more of this. A lot of common mistakes could be eliminated simply by surfacing them to developers. I don't mean to sidetrack or self-promote, but I wrote a blog post on exactly that. Would there be a possible issue here for NVDA, given that it moves keyboard focus along with the cursor? Specifically I'm thinking if you had |
unless anyone wants to be assigned moving to 1.4 |
The WG discussed a variety of author error cases we should formalize to provide a better end-user experience for assistive technology users.
An anti-pattern we see frequently is an element hidden (via
aria-hidden
) getting focused (via Tab navigation or script). Browser accessibility and AT response to this varies, but it’s never ideal.Suggestion was that, at the time any element acquires focus, if the element is hidden from the accessibility tree via
aria-hidden="true"
the user agent should remove any instances ofaria-hidden="true"
on the element and any other ancestor elements. The current thinking is that these attributes should be removed from the DOM and a warning should posted to the console (console.warn()
) so that it is apparent to web developers what is happening and why.The text was updated successfully, but these errors were encountered: