[6.x] Add autocomplete defaults to the user blueprint's name and email fields - #15423
Open
duncanmcclean wants to merge 1 commit into
Open
[6.x] Add autocomplete defaults to the user blueprint's name and email fields#15423duncanmcclean wants to merge 1 commit into
duncanmcclean wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Ah1fKV2BCBwFp4brjxWaE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request fixes an issue where the user create and account forms in the Control Panel set no
autocompleteattribute on the name and email fields, so browsers and assistive technology can't identify them for autofill (WCAG 2.1 SC 1.3.5).This was happening because the default user blueprint never sets the Text fieldtype's
autocompleteoption, even though the option has existed since #8623 and is passed through to the input.This PR fixes it by giving the
emailfield anautocomplete: emaildefault via the existingensureField()call inUserRepository::blueprint(), the same route that already gives every site's email field itsinput_type. Blueprint-defined config still wins, so an explicitautocomplete: offis respected. The fallback blueprint used when nouser.yamlexists also getsautocomplete: nameon thenamefield.Since
{{ user:register_form }}and{{ user:profile_form }}render the same blueprint, front-end forms pick up the attribute too.The
namefield isn't ensured by the CMS (blueprints may usefirst_name/last_nameinstead), so existing sites will wantautocomplete: nameadded to their ownuser.yaml. The starter kit's blueprint should get the same.Fixes #15408