cog icon indicating copy to clipboard operation
cog copied to clipboard

support a "step" option for numeric inputs

Open zeke opened this issue 3 years ago • 0 comments

Let's add support for a step option for numeric input types, so model authors can control the granularity of their model inputs. This can in turn be supplied as the step option to the HTML inputs.

The step attribute is a number that specifies the granularity that the value must adhere to or the keyword any. It is valid for the numeric input types, including the date, month, week, time, datetime-local, number and range types.

The step sets the stepping interval when clicking up and down spinner buttons, moving a slider left and right on a range, and validating the different date types. If not explicitly included, step defaults to 1 for number and range, and 1 unit type (minute, week, month, day) for the date/time input types. The value can must be a positive number - integer or float -- or the special value any, which means no stepping is implied, and any value is allowed (barring other constraints, such as min and max).

cc @evilstreak

zeke avatar Jan 18 '22 16:01 zeke