Support default `autocomplete` values for input based on `type`
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 9.4k
- Forks
- 3.2k
- PR merge metrics
- PR metrics pending
Description
If I'm reading the autocomplete processing algorithm correctly, the "default" behavior (when the attribute is absent or empty) is to not have any default at all. There are suggested heuristics for password inputs (at the very end of that section), but little else.
I would expect that for <input> elements where the valid type attribute directly corresponds to a valid autocomplete token (aka, for type="email", "tel", "url"*), that the type would be used as the default autofill field name.
The main benefit would be to reduce verbosity:
<label>Email: <input type="email" autocomplete="email" name="email" /></label>
Could I skip typing "email" just once, please?
Since most browsers support heuristics for autocomplete, I suspect the resulting autofill behavior is already widely supported. It would be a matter of making it standard & exposed to the API.
* (But not for type="image", since that's just its own weird legacy thing.)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked HTML Standard autocomplete processing algorithm and the section describing input types and autocomplete tokens. Identify which valid type values correspond to autocomplete tokens, and verify that image is excluded as noted. Done means the standard clearly defines the default behavior and its exposed API implications.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100