-
Notifications
You must be signed in to change notification settings - Fork 26
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
summary should serve as label for details #537
Comments
i'm not so sure on this one. there are times where it might be needed to provide a grouping boundary/name for a details element - but that's not always the case. Consistently giving a details a name per its summary element would introduce redundancy of the name of the summary (which someone has to interact with to expand/collapse the details content) and the details element, now with the same name, both being announced. So like... foo button, foo group (for the few instances where it'd actually be that concise... testing with firefox and VO (just cause i'm on a mac while i write this) i get "foo, collapsed, summary, group foo, details" when initially navigating to the element. and that's a bit much. Comparing summary directly to caption or legend is one of the reasons why details/summary has some of the problems it does. For example, HTML allowing summary to contain interactive elements, and the stance that summary is considered more like a "label", so therefore it can have nested inputs, buttons and hyperlinks - but where HTML does not allow hyperlinks or buttons to contain other interactive elements. Per this specific issue, caption/legends are not themselves interactive elements - so it is less likely for someone to keyboard navigate to them and thus hear their name be redundantly announced as both the name of the current focused element, as well as the name of their containing element. tldr; I understand the use cases where one might want to name their details (or do something like the following markup to cut down on redundancy when navigating to the summary element). But I question how good of an idea it would be to always name a details element. especially since it's not consistently easy (or even a good practice) to then inform people how to negate a name for their unwanted named group
|
@scottaohara Thank you very much for your detailed answer. I understand your objections and am happy to close the ticket if no one else wants to comment. Just to briefly explain why I opened the ticket:
|
HTML spec:
HTML AAM does not indicate that summary is used to label the group defined by detail. As a result, I have to explicitly label the detail element with aria-labelledby or aria-label so that my group has a label. This is contrary to the HTML specification. I suggest adding to details that the summary serves as a group label (analogous to fieldset and legend).
The text was updated successfully, but these errors were encountered: