Skip to content

html5 type="number" and floats #277

Closed
@FireSBurnsmuP

Description

@FireSBurnsmuP

It seems that just a vanilla HTML5 input won't validate as a float without adding data-validation-allowing="float".

That is:

<input type="number" min="0.0" max="6.0" step="0.5">

Will show invalid if, say, '4.5' were entered, but validate fine if '4' is entered, even though native validation would handle this just fine.

However:

<input type="number" min="0.0" max="6.0" step="0.5" data-validation-allowing="float">

works as expected.

This is an easy workaround, but I think that this could be easily auto-detected by checking if the step is a float.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions