Html: Proposal: permit `Tel` control group for `tel-national` and other telephone-related autofill fields

Created on 13 Mar 2020  路  4Comments  路  Source: whatwg/html

In WHATWG鈥檚 Living Standard, this table pairing autofill fields with permitted control groups, shows that tel-national is restricted to Text controls, whereas the tel autofill field permits Tel controls.

It seems odd to exclude type="tel" for the more granular set of telephone-related autofill fields. In fact, the second example offered in 4.10.1.7 (non-normative) does show type="tel" and autocomplete="tel-national" being used together.

I propose changing the control group for the following autofill fields from Text to the more permissive Tel:

  • tel-national
  • tel-country-code
  • tel-area-code
  • tel-local
  • tel-local-prefix
  • tel-local-suffix
  • tel-extension

Thanks for your consideration.

additioproposal needs implementer interest forms

All 4 comments

IIUC <input type=tel> is intended for complete telephone numbers ("The input element represents a control for editing a telephone number given in the element's value.") whereas the ones you've listed are incomplete (e.g. "Country code component of the telephone number"). I don't see the value in supporting the use of type=tel for partial phone numbers and it would muddy the purpose of that type, potentially reducing the ability for user agents to provide appropriate autofill suggestion for type=tel when @autocomplete is omitted. Please don't use type=tel for incomplete phone number fields.

The major value is for mobile user agents, which (assuming the inputmode attribute is absent) bring up a different keyboard depending on the type of an input field. This is illustrated in the MDN web docs.

Even if a user is entering only part of a telephone number, the telephone-number keyboard would be appropriate.

In that case you should use the inputmode attribute though.

Right, inputmode="tel" is the correct way to get a keyboard for telephone numbers when type="tel" isn't appropriate (e.g. because it's a partial telephone number).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lacolaco picture lacolaco  路  3Comments

iane87 picture iane87  路  3Comments

mustaqahmed picture mustaqahmed  路  4Comments

petamoriken picture petamoriken  路  3Comments

tontonsb picture tontonsb  路  3Comments