-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
computeAccessibleName
won't compute combobox name from self referencing aria-labelledby attr
#1018
Comments
AFAIU from the spec, that's because |
Agreed it is quite difficult to make sense of. I've interpreted those descriptions in the more abstract sense of input as in also emulating controls rather than only literal html input elements. The word input there links to https://www.w3.org/TR/wai-aria-1.2/#input describing it as
The description of combobox in the spec also says
That last part "or an element that only displays the current value of the combobox" might be the key that it isn't just text inputs? To me it appears there is intent for it to be used on div elements and we can see that in w3.org own examples e.g. In popular UI libraries it is also common to see combobox role on div elements. |
I understand. I know that @eps1lon is also involved with mui so let's wait for his call on this one :) |
@agentdylan Just my two cents here, but I've noticed this fits a pattern of issues I've seen; I have two WIP pull requests up that simply check a string is not empty before returning. I'm unsure of the exact logic, but for our use case/fork we're rolling with those WIP modifications 🤷♂️ |
When a div element role is
combobox
and the element has anaria-labelledby
attribute that references itself,computeAccessibleName
is failing to return the accessible name.Role combobox supports name from author https://www.w3.org/TR/wai-aria/#namefromauthor
According to 2B of https://www.w3.org/TR/accname-1.2/#mapping_additional_nd_te
Please correct if I misunderstand but my interpretation is it should be returning the name. I note the name is seen in Chrome dev tools in the accessibility pane.
When role is combobox the following test cases demonstrate it failing to return an accessible name when the element refers to itself using
aria-labelledby
.Test cases
Test output
At a quick glance this would appear to be because the logic is skipping to "step 2E" for role
combobox
, ultimately returning an empty string on line 649 of sources/accessible-name-and-description.tsreturn isHTMLInputElement(current) ? current.value : "";
The text was updated successfully, but these errors were encountered: