What to Use Instead of Number Inputs
Hanna Laakso documents the problems for GOV.UK. This is what they landed on:
<input type="text" inputmode="numeric" pattern="[0-9]*">
The inputmode attribute is pretty great, and we have a deep dive on that.
Phil Nash came to (almost) same exact conclusion, and blogged about improving the experience of a two-factor auth code input on the Twilio blog:
<input
type="text"
name="token"
id="token"
inputmode="numeric"
pattern="[0-9]*"
autocomplete="one-time-code"
/>
That last attribute is interesting and new to me. It means you get this super extra useful experience on browsers that support it:
June 4, 2020 at 1:49:54 PM EDT
*
FILLER