Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support default autocomplete values for input based on type #4271

Open
AmeliaBR opened this issue Jan 4, 2019 · 2 comments
Open

Support default autocomplete values for input based on type #4271

AmeliaBR opened this issue Jan 4, 2019 · 2 comments
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest topic: forms

Comments

@AmeliaBR
Copy link

AmeliaBR commented Jan 4, 2019

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.)

@annevk annevk added addition/proposal New features or enhancements topic: forms needs implementer interest Moving the issue forward requires implementers to express interest labels Jan 4, 2019
@annevk
Copy link
Member

annevk commented Sep 18, 2023

@battre @zcorpan thoughts?

@battre
Copy link

battre commented Sep 19, 2023

I think that type="email" correlates well with fields being semantically email fields or username fields (which are often email addresses). (It would be nice if we had autocomplete="username which should be an email address or a phone number but no free text".)

I see that developers use type="tel" for all kinds of numeric fields (postal code, credit card numbers, CVV fields, ...). I guess this is because inputmode="numeric" is not well known. Making this an implicit autocomplete="tel" would probably be too much.

I don't know if any browser supports autocomplete="url".

Overall I think that having no default may be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest topic: forms
Development

No branches or pull requests

3 participants