Skip to content

Conversation

@rhcarvalho
Copy link
Contributor

Reverts #6502

The choice of username over email has actually been discussed in the PR that introduced the autocomplete attribute: #5143 (comment).

That conversation links to https://www.chromium.org/developers/design-documents/form-styles-that-chromium-understands/, which in turn links to https://web.dev/articles/sign-in-form-best-practices, quoted below:

For email inputs use autocomplete="username", since username is recognized by password managers in modern browsers

If not reverting that PR, and rather deciding for autocomplete="email", then we should update leftover autocomplete="username" occurrences in phx.gen.auth template forms.

Details
$ git grep -n 'autocomplete=' | grep username
priv/templates/phx.gen.auth/registration_live.ex:30:            autocomplete="username"
priv/templates/phx.gen.auth/settings_live.ex:24:          autocomplete="username"

@rhcarvalho
Copy link
Contributor Author

rhcarvalho commented Jan 6, 2026

I'm not sure whether the CI failure is related to the changes https://github.com/phoenixframework/phoenix/actions/runs/20757919267/job/59604883857#step:4:1017, or a flake.

@SteffenDE
Copy link
Contributor

CI should be good. I'm fine with merging this - we should be consistent - but I'd be interested in knowing if there are cases where browsers or extensions actually suggest usernames (since we also set type="email"). At least it sounded like @IgnacioGoldchluk was experiencing this?

@IgnacioGoldchluk
Copy link
Contributor

In my case I had both username and email in the application, maybe that's why I was seeing incorrect suggestions? If the recommended practice is to use autocomplete="username" then I agree with the change being reverted

@rhcarvalho
Copy link
Contributor Author

If the recommended practice is to use autocomplete="username" then I agree with the change being reverted

I believe the standard practice is type="email" autocomplete="username", because that's the standard field name in password managers, e.g.:

image image image image

(those login pages match part of what I listed in #6575 for adding spellcheck="false" to the same form fields)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants