Skip to content
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

Allow headings in <summary> elements for <details> #8864

Open
yatil opened this issue Feb 7, 2023 · 5 comments
Open

Allow headings in <summary> elements for <details> #8864

yatil opened this issue Feb 7, 2023 · 5 comments
Labels

Comments

@yatil
Copy link

yatil commented Feb 7, 2023

Currently, headings in <summary> elements are not allowed and do not show up in the accessibility tree as headings. For accordions and other use cases, using headings inside the <summary> makes a lot of sense. Navigating to a heading inside the summary should set the focus to the summary and then have the expected interaction to open and close the details element.

@zcorpan
Copy link
Member

zcorpan commented Feb 13, 2023

@whatwg/a11y are there any issues with AT with allowing headings in summary?

@zcorpan zcorpan added the accessibility Affects accessibility label Feb 13, 2023
@zcorpan
Copy link
Member

zcorpan commented Feb 13, 2023

I think the issue is that summary is exposed as a button in the a11y tree, and buttons can only have plain text. So long as that is the case we can't allow headings (same as with button element).

@scottaohara
Copy link
Collaborator

headings are presently allowed, but per the way this has been implemented they don't always get exposed. this is related to #2272

@janbrasna
Copy link

FYI it's more of an AT issue with more appropriate role for this use case missing, see the discussions around this topic in general: w3c/aria#939 (comment)

@prlbr
Copy link

prlbr commented Aug 15, 2024

Headings in <summary> have been allowed for about a decade at least. That is they have been valid for as log as the Internet Archive's Wayback Machine reaches back for the currently relevant spec page: https://web.archive.org/web/20141013114912/https://html.spec.whatwg.org/multipage/forms.html#the-summary-element

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

5 participants