I have a form with an input type="number" field where the number to be entered must be a number between -1 and 1, and it can be a decimal of varying length. Some users may want to enter 0.9 while others may want to enter 0.9999. The problem I have is with the step attribute. The default value for step is 1, which is not great since my numbers need to be less than 1. I can set the step to any, which allows any number to be entered (this is good) but the default html5 up/down arrows for the input, default to increment of 1. I can set a step to the longest acceptable decimal, say 0.00001, but now each arrow increment is 0.00001 and going from 0 to 0.1 requires 10,000 increments, or for the user to click the arrow 10,000 times. What to do?
Can the arrows be eliminated? Will that help? This appears to only be an issue on desktop, as mobile browser don't display the arrows but show a keypad.
To eliminate the arrows I can use type="text" and then add a regex pattern. But in this case on mobile the user will get full alphanumeric keyboard in place of a number pad, which is less than optimal. I discovered that there exists an attribute "inputmode" which should tell the browser to use a decimal keypad, but I haven't tested it.
Do people actually use the arrows? I use them.
A second issue in regards to this input, is how should one describe this number, what should the label read. It is a percentage of some constant, but the value is expressed in a decimal. Using say gravity as an example, with an input value of 0.5 ==> 50% of gravity:
Force as a percentage of gravity
or
Force as a proportion of gravity