5 ms·
You probably don’t need input type=“number”
- howard941 8y ago> While input type="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). 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 ("tel", except for autofill I suppose) or ambiguously weirded utility, i.e. the described, broken "number"/roller field that encourages browser devs to surprisingly treat vertical mouse movements as inputs to typeable fields.
- Garvey 8y agoI feel like this is a poor example. In this case the input should never have been number in the first place.