Skip to content

User and account forms set no autocomplete attributes #15408

Description

@bpmore

Bug description

The user create and account forms collect a person's own name and email but set no autocomplete attribute, so browsers and assistive technology cannot identify the fields for autofill.

Measured on /cp/users/create:

name   type=text   autocomplete: null
email  type=email  autocomplete: null

The login form already does this correctly, which is what makes the omission look accidental rather than deliberate:

email     autocomplete="username"
password  autocomplete="current-password"

WCAG 2.1 SC 1.3.5 Identify Input Purpose (Level AA).

How to reproduce

  1. composer create-project statamic/statamic, log in
  2. Visit /cp/users/create (or /cp/account)
  3. In the console:
[...document.querySelectorAll('input')].map(i => [i.name || i.id, i.getAttribute('autocomplete')])

Every value is null.

Suggested fix

Two parts, and the second is the more useful one:

  1. Set autocomplete="name" and autocomplete="email" on the name and email fields in the user blueprint.
  2. Expose an autocomplete config key on the Text fieldtype so blueprint authors can satisfy 1.3.5 on their own front-end and CP forms. Right now there is no way to set it from a blueprint at all, which means any Statamic site collecting a user's own details in a CP form inherits this.

Filing rather than PRing because (2) is an API addition and the config key naming is yours to choose. Happy to implement whichever shape you'd prefer.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions