-
Notifications
You must be signed in to change notification settings - Fork 218
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
[Popup] is the "anchor-popup hierarchy" used to create the browser's accessibility tree? #440
Comments
While I think I am also not sure I am a fan of encoding ARIA into a new HTML element. |
@aardrian What I thought was that when a popup is shown, user agents could insert the popup's structure into the accessibility tree immediately following the popup's anchor (for easy access with virtual cursors). Of course, I figured the UA would send all of the appropriate a11y-tree-modified events (2nd table) so that AT would know, and then remove the popup structure from the accessibility tree (and send events) when the popup is hidden. What I realized is that while that would work for anchors that are in the normal document flow, and it would even work if an anchor is contained within certain portions of a complex component such as a So I withdraw my suggestion, and will close this issue, but first:
I'm not quite sure what you are saying with that sentence? Do you mean you wouldn't require authors to explicitly add However, any new HTML element will need to be mapped to an implicit role, and any new attributes will also need to have some kind of implicit mapping, in order to be useful to AT. So it's possible that |
Always happy to be a useful idiot.
I totally missed that in the explainer. Yeah, that is a huge issue. That also leans on a false (but pervasive) belief that it is ok for any element anywhere in the tree to be made interactive simply by adding event handlers. I think you should leave this issue open but ask where in the accessibility tree it will be inserted. Nearest ancestor where it is legal? First legal descendent? Uranus?
That is what I am saying. The explainer shows an example of a pop-up menu: <button aria-haspopup="true" aria-controls="menuPopup" id="menuButton">Menu</button>
<popup id="menuPopup" role="menu" anchor="menuButton">
<!-- Markup for menuitems goes here -->
</popup> Because there is no dedicated trigger element (attribute?), ARIA is necessary here. I am not sure how to get around the ARIA in this context. Similarly, while Anyway, a dedicated trigger element (or attribute) might mitigate that. From another issue, I mulled over this construct (to also remove the need for reliance on JS): <button for="Foo" open>
<popup id="Foo">
Hey there.
</popup> And to your point about |
Thanks @carmacleod for opening this issue, and sorry it took me awhile to get back to you…working my way through a long list. :) "Should anchored positioning hoist the popup to a different part of the accessibility tree?" is something we've discussed a bit internally and need to call out in the explainer as an open issue for further discussion. Two things simultaneously true:
FWIW and related to this discussion: I would want such a declarative invocation attribute to be applicable only to interactive elements (perhaps a subset of these). It seems ok to provide more flexibility around invocation through the JS API (i.e. sometimes the logic for showing a popup may not be driven off of interaction but off of time or some other internal app logic), but if the platform handles scriptless invocation that should only be done on elements where that would be sensible and expected. |
Thanks again for asking, @carmacleod! I've ported this discussion over to openui/open-ui#328. |
The Anchoring section of the explainer says:
It would be nice if this hierarchical relationship was used to construct that portion of the accessibility tree, so that even if the popup is placed somewhere else in the DOM, it would still follow its anchor in the accessibility tree, which would be the logical and most useful place to find it when a screen reader user is using their reading/virtual cursor.
The text was updated successfully, but these errors were encountered: