Description
For a project I'm working on, I need to be able to accept floating point numbers in one of my forms. Currently, when I try to input a floating point number in one of my fields that has the following schema:
{
type: 'number',
required: true,
model: 'sample_thickness',
label: 'Sample Thickness',
hint: 'The thickness of the sample in mm',
default: null,
}
I receive an error from Chrome when submitting:
I don't currently have a v-on:click="submit"
attribute on my button, which is the main reason that Chrome is intervening in the first place, however I feel that the fields should still accept floating point values.
One easy way to support floating point values is to use HTML5's step
attribute on <input type="number"></input>
tags. Setting step="0.1"
causes the up/down buttons on the field to increase/decrease the number by 0.1. Additionally, setting it to step="any"
causes any number to be accepted.
Where the schema currently accepts a max
and min
parameter, it could also accept an any
parameter.