TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

You probably don’t need input type=“number”

4 pointsby skellertorabout 6 years ago

2 comments

howard941about 6 years ago
&gt; While input type=&quot;number triggers numeric keyboards on touchscreens leading to better mobile UX, that can also be accomplished by configuring the pattern attribute in a certain way (Zach Leatherman has a great deep dive post into all of this).<p>The pattern attribute workaround is fine but limited to iOS as Leatherman himself notes, and its implementation treats other mobile users as second class citizens, reduced to the non-existent numeric row (at least on Android). The root cause of this mess is IMO the spec that inexplicably defines two fields of near zero (&quot;tel&quot;, except for autofill I suppose) or ambiguously weirded utility, i.e. the described, broken &quot;number&quot;&#x2F;roller field that encourages browser devs to surprisingly treat vertical mouse movements as inputs to typeable fields.
Garveyabout 6 years ago
I feel like this is a poor example. In this case the input should never have been number in the first place.