Skip to content

specify unique behavior for label and value attributes on option in datalist #568

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

Open
scottaohara opened this issue Nov 7, 2024 · 2 comments

Comments

@scottaohara
Copy link
Member

scottaohara commented Nov 7, 2024

within a select element, if an option has a label attribute and child content, the label attribute value renders and the child content does not. the value attribute, which is not rendered for select elements, can also be rendered for datalist options, which then also needs to be considered for what the visible name for these options would be.

but within a datalist, if an option has both a label attribute and child content, both will render - and again, if a value attribute is in the mix, then that will often take precedent over one of the other labeling mechanisms.

browsers expose this differently - where chromium exposes both pieces of information, safari renders both but only exposes one, and firefox only renders and exposes one of the two.

this needs cleanup

scottaohara added a commit to w3c/aria that referenced this issue Nov 7, 2024
this commit also contains commented out content to address w3c/html-aam#568 in a future PR
@spectranaut
Copy link
Contributor

Discussed briefly in triage: https://www.w3.org/2024/11/14-aria-minutes.html#ffff

We could bring up in meeting to try to find someone who wants to champion recommending a way forward.

@scottaohara scottaohara changed the title specify unique behavior for label attribute on option in datalist specify unique behavior for label and value attributes on option in datalist Mar 12, 2025
@scottaohara
Copy link
Member Author

just noting per the lengthy comment I just made in the HTML issue about datalist options, that as part of this PR it needs to be explicitly called out in the option accName steps that value contributes to the name / visible label of an option only in if the option is a child of a datalist

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

No branches or pull requests

2 participants