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

autocomplete attribute for select element (Success Criterion 1.3.5 "Identify Input Purpose") #4162

Open
caztcha opened this issue Dec 6, 2024 · 8 comments

Comments

@caztcha
Copy link

caztcha commented Dec 6, 2024

This is just a question regarding the interpretation of WCAG Success Criterion "1.3.5 Identify Input Purpose".

If the prefecture input is implemented using <select> element, instead of <input type="text">, for a user's postal address, is the lack of autocomplete attribute is considered a failure of this success criterion? Or should we implement the <select> element with autocomplete attribute like this?

<label for="prefs">Prefecture</label>

<select autocomplete="address-level1" id="prefs">
<option>Hokkaido</option>
:
<option>Tokyo</option>
:
<option>Aichi</option>
:
<option>Kyoto</option>
<option>Osaka</option>
:
<option>Fukuoka</option>
:
<option>Okinawa</option>
</select>

According to HTML Living Standard, most of the "autofill field name" including "address-level" seems to be appropriate only for TEXT control, thus inappropriate for <select> element.
https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field

Based on this, I would think that the lack of autocomplete in the <select> element would not be considered a failure of this success criterion. Am I correct?

Or is it necessary to include autocomplete attribute in such <select> element, in the hope for future that assistive technologies will use the autocomplete value as a cue to present a symbol for users?

I would appreciate it if you could let me know your views on this.

@TestPartners
Copy link

TestPartners commented Dec 6, 2024 via email

@caztcha
Copy link
Author

caztcha commented Dec 6, 2024

Thank you for your comment, Steve.

Yes, I understand the key intention of this SC 1.3.5 is that user agents can identify the purpose of an input and display an appropriate icon or other means of identification.

As you mentioned above, HTML Living Standard says that the <select> element can contain autocomplete attribute. I am cofusing because the Standard also says that the "autofill field names" (which seems to be common with the input control purposes listed in the 7. Input Purposes for User Interface Components in WCAG) are appropriate only for TEXT input.

When conductiong WCAG audit, and encountered the <select> element (with address-level equivalent options) lacking autocomplete attribute, then is it a failure of SC 1.3.5?

@patrickhlauke
Copy link
Member

patrickhlauke commented Dec 6, 2024

1.3.5 is a bit ... vague (nothing new when it comes to WCAG) here. in theory, autocomplete isn't the only way in which to pass ... there had been talk of other ways to do things, like RDF attributes or really anything that would count as programmatic information that can convey the purpose of an input... but for better or worse, autocomplete is the de-facto way to achieve things in HTML. so, even though there may not be any actual practical use (in terms of ancillary benefits like actually having browsers autofill things), I'd say yes the absence of an appropriate autocomplete would be a failure.

(speaking of vague, the actual HTML standard is also eminently confusing/confused when it talks about autocomplete, with its weird "autofill expectation mantle" and "autofill anchor mantle" distinction, and the fact that even though on one hand it even mentions things like <select>, it then still keeps talking about input in most prose)

@JAWS-test
Copy link

are appropriate only for TEXT input.

in the table it says "TEXT" (not "TEXT input") and this refers to:

https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#control-group-text

and there you find: select

@caztcha
Copy link
Author

caztcha commented Dec 6, 2024

Thank you @patrickhlauke
I was confused, but by reading your comment I understand that autocomplete is likely to be necessary in the case I posted at the beginning.

@caztcha
Copy link
Author

caztcha commented Dec 6, 2024

Thank you @JAWS-test

in the table it says "TEXT" (not "TEXT input") and this refers to:

https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#control-group-text

and there you find: select

Oh my goodness. I overlooked it completely. Thank you so much for pointing it out.

@mbgower
Copy link
Contributor

mbgower commented Dec 6, 2024

Draft working group response
The autocomplete attributes apply to select elements. In the information following the table in the hmlt5 spec, select elements are explicitly listed under each of the group categories in the table.

The working group will add some information to the understanding document or to the existing technique (or both) to clarify this.

@caztcha
Copy link
Author

caztcha commented Dec 6, 2024

Thank you for sharing the draft working group response. I appreciate everyone taking time for my question.

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

5 participants