Closed 36degrees closed 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?
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?
That's my understanding, yes – MDN seems to suggest that's the case too.
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 theattributes
object, but https://github.com/alphagov/govuk-frontend/issues/1136 will introduceautocomplete
as a top-level option.Done when…
autocomplete
attribute.autocomplete
attributes where appropriate