Skip to content

html.elements.input.type_number - Under browser compatibility it says supported by firefox. This is incorrect. #18050

Closed

Description

@thecodemonk

What type of issue is this?

Incorrect support data (ex. Chrome says "86" but support was added in "40")

What information was incorrect, unhelpful, or incomplete?

Under browser compatibility it says it is compatible with FireFox. Using version 106.0.1 (64-bit), this doesn't work. Up down arrows appear, but you can type in any alpha character which also breaks the up and down arrows. This should be changed to incompatible.

What browsers does this problem apply to, if applicable?

Firefox

What did you expect to see?

Since this feature doesn't work in firefox, I expected that section to show No, instead of Yes.

Did you test this? If so, how?

Yes, I went to the page and used the Try It section while using the latest version of FireFox (106.0.1 (64-bit)).

Can you link to any release notes, bugs, pull requests, or MDN pages related to this?

Go to this page and try it.

Do you have anything more you want to share?

No response

MDN URL

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number

MDN metadata

MDN page report details
  • Query: html.elements.input.type_number
  • Report started: 2022-10-20T15:12:26.888Z

Activity

  1. teoli2003 commented on Oct 20, 2022

    @teoli2003
    Contributor

    Looks ok to me. Have you tried to run a constraint validation?

    If the value entered into the element exceeds this, the element fails constraint validation.

    Without running constraint validation, it won't do anything.

  2. thecodemonk commented on Oct 20, 2022

    @thecodemonk
    Author

    Chrome and Edge do not even allow non-numeric values to be entered. There is a bug write up on Bugzilla for firefox that this has been broken for the last 5 years. I don't think it's appropriate to say this is "working" and should need extra validation for it to work as it would be expected to work.

    This also really doesn't have anything to do with constraints either. It's supposed to be a numeric input, but it's allowing non-numeric characters to be input and setting the value to "".

  3. mgol commented on Oct 20, 2022

    @mgol
    Contributor

    The spec doesn’t mandate what the user interface looks like; please read the following carefully:
    https://html.spec.whatwg.org/multipage/input.html#number-state-(type=number)

    In particular:

    This specification does not define what user interface user agents are to use; user agent vendors are encouraged to consider what would best serve their users' needs.

    Also:

    If the user agent provides a user interface for selecting a number, then the value must be set to the best representation of the number representing the user's selection as a floating-point number.

    Firefox does support the API. Whatever you think about the choices made in the Firefox UI, it doesn’t change the fact the browser does support the API.

  4. thecodemonk commented on Oct 20, 2022

    @thecodemonk
    Author

    I did read it carefully, especially the part that you highlighted first... What would better suit a user's need? This is not suited well here, thus should be noted appropriately. Since this doesn't help anyone by allowing all input, thus confusing a user as to why something went wrong, then the lack of support should be noted appropriately, which it is not here.

    Supporting an API and implementing that API are vastly different things.

    The bugzilla report also made the same argument that it is supported, yet has come up dozens of more times as people continue to write up that it is, in fact, a bug. If it walks and quacks like a duck, it's probably a duck.

  5. added
    data:htmlCompatibility data for HTML features. https://developer.mozilla.org/docs/Web/HTML
    on Oct 20, 2022
  6. mgol commented on Oct 20, 2022

    @mgol
    Contributor

    I did read it carefully, especially the part that you highlighted first... What would better suit a user's need?

    This part says "user agent vendors are encouraged", not "required" so this is not a hard requirement.

    Also, even Chrome & Safari do allow some non-numeric data to be entered - namely, you can enter the letter e. Many people don't know the scientific notation so they would be surprised about that as well.

    I do agree the current behavior around <input type=number> is generally confusing; a lot of the issues are caused by how the API is designed and that e.g. there's no concept of retrieving the user-provided value if it's invalid - you just know it's invalid. It's also true that browser differences here may surprise people so it'd be good to add a note to the compat table about this difference in implementation; it might be attached to the Firefox entry (although, the site maintainers should make the decision here). That would be informative and would resolve the confusion many developers might have.

    I do not agree, though, that Firefox should be marked as red as the API is supported.

  7. teoli2003 commented on Oct 21, 2022

    @teoli2003
    Contributor

    Closing per comments.

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

    data:htmlCompatibility data for HTML features. https://developer.mozilla.org/docs/Web/HTML

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions