Touch devices usually display a keyboard that fits the input type. E.g. <input type="tel">
would trigger the phone keyboard.
Unfortunately implementations of alternative input fields are inconsistent across browsers and developers often have to fall back to text inputs.
Another case where text inputs are required is if the values were to be formatted, even if the field only accepted number values.
A new attribute on input fields could explicitly state the best on-screen keyboard type for that field.
Example keyboards are:
- Text
- Alphanumeric
- Numeric
- Phone
- Date
- Time
- Datetime
- Emoji