3 ms·
There should be seperate types: <input type=integer> <input type=float> We need 2 different input keyboards on mobile: it should not be possible to ty
by silvestrov 4y ago
There should be seperate types:
<input type=integer>
<input type=float>
We need 2 different input keyboards on mobile: it should not be possible to type a dot if the input must be an integer.
Currently seems to difficult to get a simple integer input: Chrome and Safari does not interpret step=1 as "no decimals".
Also: the up/down buttons should go. That should be an explicit option as they don't make sense in most cases. Might have a type=count for that.
- lazide 4y agoAlso fixed precision (aka currency) values.
- silvestrov 4y agoMight be woth having a <input type=currency currency=DKK> so the keyboard input can clearly show the currency that is entered. This can be very important in multi-currency applications, e.g. travel (both customer and admin). Currency attribyte is ISO code: https://en.wikipedia.org/wiki/ISO_4217 https://en.wikipedia.org/wiki/ISO_4217 Also: <input type=count> which shows up/down arrows, and is a special case of <input type=integer>
- lazide 4y agoThat actually sounds like an idea whose time has definitely come. Anyone here on the HTML standards body (or works for Google in the requisite part of the Chrome team)? There are other uses for fixed precision besides currency (co-ordinates, tolerances, etc.), but currency would be used a LOT!
- jaywalk 4y agoVery good summary of the issues I've found with it as well. I've had to instruct my developers to never use this input type, and use an Angular directive to limit input values instead.
- hebrox 4y agoI was just looking into this today. iOS shows a decimal separator (a comma in the Netherlands) with `inputmode=decimal` and none for `inputmode=numeric`. You can try it out here: https://output.jsbin.com/necuzoj https://output.jsbin.com/necuzoj
- thayne 4y agoOr even have a separate attribute to indicate that it only allows integers and maybe one to enable/disable the up/down buttons.