shibro
Show the version of “A phone field takes what is typed and says why it is asked”

Advanced inputs · SU-319

A phone field takes what is typed and says why it is asked

Flip between the version shibroUI flags and the one it ships. The marks and callouts show what changes.

  • Pasted +44 7700 900982 mangled by the mask
  • Country picker GB +44 · searchable
  • Error a valid UK number fails
  • Number field as typed · 20ch
  • Why we ask in the hint · optional

What changes

Bad
A US-style mask with no country picker: pasting +44 7700 900982 becomes (440) 770-0900 and fails with Enter a valid phone number.
Good
A searchable GB +44 country picker and a free 20ch field holding 07700 900982 as typed, with the hint We only text you about delivery. Optional.

The rules

  • SU-319

    Phone fields accept what people type and explain the request. Use type="tel" with autocomplete="tel" and accept spaces, hyphens, brackets and a leading "+"; never mask while typing. Put a searchable country picker (name plus dial code, defaulted from the locale) to the left of the number, validate with a phone library on blur, and say why the number is wanted or make it optional. Width about 20ch.