Right now the step attribute for number_input defaults to '1' when cannot be inferred from validations and is not either supplied in the options.
It is ok for integer values, but when you have a float field in the database, an input type="number" is also rendered with step="1" and the browser doesn't submit the form when you enter a non-integer value. I think in this case it should use step="any"
This patch makes the step attribute defaults to "any" instead of "1".
Default step attribute to 'any' in number_input.
Seems good for me.
What happens in modern browsers when step is set to any?
If you use step="any" modern browsers let you send float values. If you don't use it and use step="1" instead, modern browsers let you send only integer values.
I have to say that I only tested that with Chrome 13.
According to W3C, this is the specification.
Thanks for submitting.