3 ms·
> I tried out the demo and was dissapointed that for number inputs a regular `<input type="text">` is used. This removes any option to add numbers by using the
by thaumasiotes 4y ago
> I tried out the demo and was dissapointed that for number inputs a regular `<input type="text">` is used. This removes any option to add numbers by using the arrow up keys on a keyboard.
Do not ever use the number input type, for any purpose.
If you have a number element on your form, people will accidentally mangle their own inputs, because the value in such an element silently changes when you use the mouse wheel.
- daliusd 4y agoMy iPhone does not have mouse wheel :sad_panda:
- aaaaaaaaata 4y agoDisallow wheel input...still get a number pad on tablets and mobile?
- thaumasiotes 4y agoThat is what the inputmode attribute is for. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input#inputmode https://developer.mozilla.org/en-US/docs/Web/HTML/Element/In...
- peterangular 4y ago> If you have a number element on your form, people will accidentally mangle their own inputs, because the value in such an element silently changes when you use the mouse wheel. Yeah this can happen if you're dispatching scroll events to all descendants. but typically it is not an issue if you haven't messed with how the browser scrolls with JS. What platforms does this happen to your users on? My anecdote is that I've used numeric fields in all sorts of situations and have never ran into this outside of scroll-hijacked sites. I tend to respect the browser's implementation of the input types and find that they're fully functional - especially in 2022.
- padseeker 4y agoOMG you're my hero. The number input is quantifiably AWFUL