-
Notifications
You must be signed in to change notification settings - Fork 125
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
Is aria-expanded not supported by the searchbox role? #1680
Comments
If your search box behaves like a combobox, it should be marked with role=combobox instead of searchbox. It may also be possible to modify the ARIA specification to allow a searchbox to act as a combobox. This would need to be discussed at https://github.com/w3c/aria |
Related: #681 |
Thanks for your reply @JAWS-test .Yes, it behaves as a combobox in that it has a popup with suggestions below the search box as you type (autocomplete="list"). I'm using the keyboard navigation in the combobox pattern using the aria-activedecendant (supported by searchbox). But screen readers will not identify it as a search box, and I'm currently using the aria-label to inform users of that. |
In my opinion there is an important difference between combobox and autocomplete, which is unfortunately often not considered, so that there are many implementations on the web that are badly usable with screen readers, see w3c/aria-practices#1134 (comment). If no list of values can be opened without text input, but only after text input, then it is not a combobox. Unfortunately, there are no attributes that indicate the fade-in of the list for a textbox or searchbox. Therefore, a live region is usually used for this, see: https://jqueryui.com/autocomplete/ |
Our search box will usually display suggestions without text input (zero term suggestions), but it depends what suggestions providers are configured and previous actions of the users. But it is not a filtering of a limited number of entries as mentioned in #1134 (comment). |
This sounds like a edge case: an autocomplete function that displays suggestions without text input. I would advocate not marking it with role=combobox, but as an autocomplete list. If per live region the presence of list entries is output, this should be sufficient. |
Zero term suggestions for search boxes are not uncommon, so it is not an edge case in that sense. When I click in an empty search box on google.com I get suggestions from/related to recent searches. They are using role="combobox" for their search box - but I'm not advocating doing the same just because it is highly used search box. |
There is certainly a spec issue here:
If all of this is correct then the only values which should be allowed for Otherwise aria-expanded should be supported on textbox/searchbox. |
textbox and searchbox should not allow only autocomplete=inline/none - otherwise many web pages would be invalid. Most autocompletes use list or both. Thus, the following should be implemented:
|
Topic discussed (per duplicate issue #1875) on Feb 23, 2023 - https://www.w3.org/2023/02/23-aria-minutes#t05 |
On oct 11, 2023, @jcsteh wrote:
|
This external issue linked to 1875 - linking here instead as this issue will take the place of that other issue (since there was more discussion here) |
FWIW - it probably does make sense to allow aria-expanded on textbox / searchbox - but there should be different exceptions for the attribute per the context of those roles? e.g., expanded could indicate a popup has been revealed that allows for text correction/suggestions, or a popup is displayed to render search results or related topics - none of these serve the purpose of choosing an option to return a value to the input (that's what a combobox is for anyway) - but the expanded state would allow these other existing patterns to be more accessible, while not forcing every text input field to become a combobox if someone had the audacity of making the field invoke a popup ... |
Hi! I've been working an a search box with a suggestion popup, where I have applied the role="combobox". I recently realized that the role="searchbox" is probably more fitting. But on closer inspection it seems that aria-expanded attribute is not supported for this role. Searchbox is not listed as a role supported by aria-expanded, and aria-expanded is not listed as inherited state and properties of the searchbox role, but it is required for the combobox role. The searchbox role do support aria-controls, aria-haspopup and aria-owns. Should the role then not also support to indicate the the controlled popup is expanded?
If this is not the correct forum for this question, please point me in the right direction.
The text was updated successfully, but these errors were encountered: