Skip to content

input type="number" does not allow floating point numbers #141

Description

@trajano

the spec allows for floating point numbers if you have step specified e.g.

<input type="number" step="0.01" min="0.01" name="amount" />

But setValueAttribute of HtmlNumberInput requires a long v alue

    @Override
    public void setValueAttribute(final String newValue) {
        try {
            if (!newValue.isEmpty()) {
                Long.parseLong(newValue);
            }
            super.setValueAttribute(newValue);
        }
        catch (final NumberFormatException e) {
            // ignore
        }
    }

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions