alphagov / govuk-design-system

One place for service teams to find styles, components and patterns for designing government services.
https://www.gov.uk/design-system
MIT License
511 stars 232 forks source link

Provide guidance on the use of the autocomplete attribute #696

Closed 36degrees closed 5 years ago

36degrees commented 5 years ago

What

Add guidance to help users use the autocomplete attribute correctly. Components where it would make sense to use this attribute include:

Examples will also need updating to use autocomplete attributes where appropriate.

Why

WCAG 2.1 introduces a new success criteria "1.3.5 Identify Input Purpose" which "is to ensure that the purpose of a form input collecting information about the user can be programmatically determined, so that user agents can extract and present this purpose to users using different modalities".

Broadly speaking, we can help service teams meet this criteria by telling them how to pass autocomplete attributes to components.

At the minute this can be done by passing autocomplete as part of the attributes object, but https://github.com/alphagov/govuk-frontend/issues/1136 will introduce autocomplete as a top-level option.

Done when…

36degrees commented 5 years ago

If we add autocomplete attributes to code examples in components and patterns, is there a risk that users will copy and paste these into their applications and not change them, resulting in incorrect autocomplete values?

edwardhorsford commented 5 years ago

If I recall correctly, these attributes have no bearing on whether browsers save data for reuse - it's only about what might potentially get auto-filled, or otherwise giving an more semantic meaning to fields - is this correct?

36degrees commented 5 years ago

That's my understanding, yes – MDN seems to suggest that's the case too.