-
Notifications
You must be signed in to change notification settings - Fork 362
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
Research into role=searchbox. Where and how is role searchbox meant to be used? #1903
Comments
I don't understand your question. searchbox is an input field for search. As far as I know, it cannot be used with combobox. |
@JAWS-test I am seeing the searchbox role being used in place of role combobox and in other ways. As I cannot find clarification in using the role I am seeking a clear understanding of how it is intended to be implemented. |
It appears that it's for when devs insist on turning this In all the 1.2 combobox examples, the input inside is getting the I would tell developers if users can't tell it's for searching, they have crappy labels/instructions. It looks like The small mention I see in the spec doesn't mention anything about widgets so I'm going to guess the confusion by devs is because in the past (like the current 1.1 stuff) have |
So any component that acts like a combobox with a listbox pop up (ARIA1.2 implementation), which I have been recommending for many years thanks to @accdc, should be exactly that. Role searchbox is implemented as div role searchbox etc. And submitting this adds a list of link results in the page/new page whatever. It does not pop up a listbox. @StommePoes once again your vocabulary has me smiling 😀 |
Small note: In HTML I can combine type=search with list and datalist. This is not possible in ARIA due to the limitations of combobox. But that doesn't seem to be a problem to me, because type=search and searchbox are anyway only output as normal input field (i.e. like type=text, textbox) by the screen readers I know. |
Yeah I can't remember ever hearing anything special when running into those... and I only recall people wanting to use type=search because specifically Safari would offer users this cute useless little "x" inside the then-bubblegum-aqua-teen-hunger-force-style fluffy inputs that I guess you could click with a mouse to clear your search terms. |
I have been looking at the spec again and I still have some confusion. If role searchbox is equivalent to <input type="search". Why does the role include the Inherited States and Properties: aria-activedecendent, aria-haspopup, aria-controls, which are the same attributes as role combobox. If role searchbox cannot be used as combobox, why does it include these inherited states and properties? So I don’t understand why role searchbox and role combobox are not interchangeable if searchbox is equivalent to <input type="search", and both inherit the same states and properties. This is why developers use searchbox interchangeable with combobox and don’t consider the basic usage that role searchbox = HTML <input type search. |
It might very well be due to the old combobox pattern from the 1.1 Authoring Practices, which had So if |
searchbox role |
I agree this is confusing, and we are going to have to address the differences at some point to clarify it, though I'm not sure where as yet. E.G. A note in the ARIA spec or the APG. As far as I've always understood, textbox and searchbox were basically the same thing, other than that searchbox was meant to go inside a role=search region for site search sections, primarily to handle autosuggest functionality that often occurs in many such controls (see google.com :) though searchbox is not used there). For a while there was even similar behavior with role=textbox, where on popular sites like linkedin, facebook, and twitter, the comments edit fields would cause autosuggest listboxes to appear if certain character combos were used, such as hash tags and so on, which completely destroyed the accessibility of any screen reader actually trying to write within that field since aria-activedescendant was often used in combination with this, thus making it impossible to even hear or review what you were typing into those fields. Thankfully they all appear to have stopped doing that in recent years,. Even so, the spec mappings still have remnants that tie into these old and terrible implementations. So yes, I agree this is about as clear as mud and should be made clearer in the future to make using these controls more reliable going forward. |
My understanding There is no difference between them other than the expectation (on some platforms) that a searchbox might cause a clear button to be rendered when it contains text. I don't believe I have ever used Looking at Core-aam the only difference in the mappings are extra object attributes (on most platforms) and a sub-role (on Apple). Looking at the Chrome source code I see they add an internal roledescription ("search box" on windows, "search text field" everywhere else, which is used - but otherwise I believe it acts exactly like a text box I don't think search has ever had any indiction that it does or doesn't perform auto-suggest. |
I think because these attributes can also be used with textbox and many other roles and are not limited to combobox. I can use aria-activedescendant for example with textbox and searchbox for the autocomplete suggestions (without using a combobox) A second reason: searchbox inherits these attributes from textbox. If textbox should have more attributes than searchbox, because textbox can be used with combobox and searchbox cannot, then the hierarchy of ARIA roles no longer works correctly at that point |
A searchbox is nothing more than a textbox that might be announced as "search box", "search edit", or "search field" by some screen readers. Because it may be announced with one of those roles, it would be redundant to include the word "Search" in the accessible name. For example, on the Telstra site, JAWS reads the search input as:
In that example, because the accessible name is "Search telstra.com", using the Presumably, because assistive technologies know the input is for search, they could provide a function for helping users locate any available search input. Thus, one could argue that use of role @StommePoes, Note that:
As @JAWS-test and @jnurthen pointed out, there is no specific expectation that a searchbox either does or does not provide suggestions for values for the input, i.e., autocomplete. ARIA supports autocomplete functionality for any kind of text input. I helped author the ARIA 1.1 changes to aria-controls, aria-activedescendant, and aria-autocomplete to allow this. This is essential to support things like mentions in text areas, such as this GitHub comment composer. So, since a searchbox is a text input, you could make it work just like an editable combobox. Just follow the 1.2 combobox pattern but give the text input role searchbox instead of role combobox. Screen readers should (but might not) announce the availability of autocomplete. Again, this has dubious value at this time, but it is certainly permitted and would likely work just as well as any combobox save the verbosity concern I expressed above. In short:
|
@mcking65 thank you for this complete explanation. Closing. |
I have researched the ARIA issues and specification related to the searchbox role and there seems to be no clarity around its usage.
In my workplace I am finding developers are applying it in various way because of this lack of guidance in the ARIA documentation.
As an accessibility tester (Accessibility Senior Specialist) I would like to understand the role and how this should best be conveyed to developers.
If there is a draft or other example of using the role searchbox, either with a listbox popup or other method of providing search results, please let me know the link. Otherwise I would appreciate guidance on how this role is meant to be used in a search type component.
Thanks.
References and comments:
ARIA 1.2 Role Searchbox specification
A type of textbox intended for specifying search criteria. See related textbox and search.
Base Concept: <input[type="search"]> in [HTML]
Authoring Practices Guide entry for role searchbox #1115
carmacleod commented on Jul 27, 2019
"There is already a search section and example in the APG. It's in the landmarks section.
Guidance: http://w3c.github.io/aria-practices/#aria_lh_search
Example: http://w3c.github.io/aria-practices/examples/landmarks/search.html
Also, in case it's helpful, there's a search example being developed in the Web Accessibility Tutorials:
https://w3c.github.io/wai-tutorials/ideas/search/"
In this issue the links provided the Guidance and Example relate to role=search and not role=searchbox. The search example link is broken.
mcking65 commented on Aug 31, 2019
"We do not yet know what kind of guidance we will provide for the searchbox role in the APG."
Extending guidance for comboboxes that use searchbox role #1158
After much discussion that has no conclusion, only opinion and observation, "mcking65 commented on Nov 20, 2019"
"searchbox is no longer a possible part of the combobox pattern."
Revise combobox design pattern to reflect ARIA 1.2 requirements #1250
There is no guidance on combobox vs searchbox and the only reference to searchbox is @mcking65 mcking65 mentioned this issue on Nov 20, 2019 as a reference back to "Extending guidance for comboboxes that use searchbox role #1158"
The text was updated successfully, but these errors were encountered: