Search code examples
formsautocompleteaccessibilityscreen-readers

For accessibility and screen reader users, is having autocomplete on form fields useful or is it possibly annoying?


I'm working on making a large web form accessible to screen reader users and I'm not an accessibility expert. Would having autocomplete on the individual fields be useful to screen reader users or would they possibly find it annoying?

To be clear, the autocomplete I'm talking about is pre-populating the form with common values they've filled out elsewhere. I'm not talking about a typeahead.

<label for="firstName">First Name:</label>
<input name="firstName" id="firstName" type="text" autocomplete="given-name" />

I assume it would be helpful, but again, I'm not an expert.

It looks like a common naming scheme for autocomplete can be found at:
https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill

Are there any gotchas for doing this for screen readers?

I only have NVDA and Narrator to test with.


Solution

  • Autocomplete might be annoying when it’s inappropriate or misused.

    given-name is personalised and intended for the app user. If a form to manage users would provide this attribute, the list of suggestions would be spammed with names of other people.

    password in such a form is then even dangerous, as the user’s own password would be suggested for another user.

    This might be annoying for anybody, not only screen reader users.

    You’d need to talk to some screen reader users to know their opinion and if they find it annoying in some situations.


    As far as I know, providing correct autocomplete values is the best practice.

    It’s native HTML, and browser support is really good.

    Since it’s the browser that provides the list of options, I’d assume it to be reliably exposed to assistive technology.

    The WCAG list it as a sufficient technique to identify input purpose

    This technique is Sufficient to meet 1.3.5: Identify Input Purpose.

    WebAIM recommend it in their guidelines for accessible forms.

    Also the GOV.UK Design System recommends using autocomplete as well. They often run usability testing with testers with disabilities. Also, they mention that it might be necessary to be conform with the WCAG:

    If you are working in production and there is a relevant input purpose, you’ll need to use the autocomplete attribute to meet WCAG 2.1 Level AA.

    WebAxe recommend using datalist over an ARIA combobox, which also relies on that list being produced by the browser.

    I would conclude that there is a large consent in the accessibility community to autocomplete attributes improve accessibility, not harm it.