Found this very helpful video from Google about autofill which overlaps this functionality: https://marketingplatformacademy.withgoogle.com/events/boost-conversions-with-autofill-optimizing-checkout-and-signup-flows
In answer to your original question...
Knowing both is used as a hint for mobile browsers, I couldn't find a real doc about the difference between using
<input type="tel">
and<input inputmode="tel">
. So
what's the difference?
which is better to use?
why duplication if it's the same?
...according to that video at 16:21 :
inputmode
used with either tel
or email
eliminates any validation of the format entered, suggesting that type
does. The presenter in the video says that a browser-generated error would display if the entered data does not resemble a valid telephone or email address.
It seems that it would be better to use inputmode
when you are using tel
or email
to pop keyboards for whatever reason but don't actually want a telephone or email address or want to avoid the validation/error message. If you do want that, then use type
.
Not the same; not an exact duplicate function.