-
Notifications
You must be signed in to change notification settings - Fork 127
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-controls
with late-mounted elements
#1956
Comments
IMO this is a false positive from the tools as the behaviour is defined.
Maybe we should move this from the Handling Author Errors section (9.2) to the States and Property Attribute Processing Section (8.6) to indicate better than this is supported behaviour not an error to be flagged by validators. |
Sounds good, that answers my question.
It could be nice to attach a note about that in the spec. Unless you want to keep this open to track moving it in a new section, this issue can be closed. |
@mcking65 - I'm looking forward to pairing with you on this issue |
@mcking65 - based on @jnurthen suggestion to move the statement from the Handling Author Errors section (9.2) to the States and Property Attribute Processing Section (8.6) here's my revision proposal:
Proposal:8.6.1 ID Reference Error ProcessingUser agents MUST NOT expose WAI-ARIA attributes that reference unresolved IDs. For example:
In addition, user agents SHOULD ignore ID references that do not match the ID of another element in the same document. It is the web author's responsibility to ensure that IDs are unique. If more than one element has the same ID, the user agent SHOULD use the first element found with the given ID. The behavior will be the same as If the same element is specified multiple times in a single WAI-ARIA relation, user agents SHOULD return multiple pointers to the same element.
|
related #1970 |
This is purely imho, but I feel like having a way to express that elements are late-mounted would be neat. It would allow a11y validators to provide useful feedback if there is indeed an The spec is hard to consume for most devs, so good validator feedback is an important aspect to improve web a11y. |
@mpaiva what you suggested above looks good, can you open a PR? I just looked up the meeting discussion of this item: https://www.w3.org/2023/06/22-aria-minutes#t04 We also talked about recommending validators supply a warning when aria-controls has an invalid ID or no ID... which I believe means adding an "Authors SHOULD" statement somewhere... maybe in the aria-controls section? That could be done in a separate PR. |
Thanks @spectranaut - I'll add the authors SHOULD and will create a separate version of the example specifically for The PR should come in the next week or so. |
Question: is there a serious perf issue with having an empty div and then adding the late mounted content inside of that div? This is how I have addressed this issue as a developer and I don't think I noted any serious issues with it. |
Describe your concern
I've been investigating the output reports of tools such as lighthouse that present ARIA issues. One common issue we have is with buttons that have
aria-haspopup="menu"
andaria-controls={elementId}
, where we don't actually mount the corresponding menu DOM element until the point where the button is clicked. This is done for performance reasons for cases where there are a lot of elements, which is particularly important for lower-end devices.My question is, is there a way to mark late-mounted elements with ARIA? If so, how?
Link to the version of the specification or documentation you were looking at at.
Link to documentation: https://w3c.github.io/aria/#aria-controls
Does the issue exists in the editors draft? Unsure/NA
The text was updated successfully, but these errors were encountered: