6
msdsk
2y

Do NOT try to re-implement input type="number" but with nicer formatting. Do not even think about it. DO FUCKING NOT. It's a trap.

Comments
  • 2
    Just some padding please? 🥺
  • 2
    type=number is broken AF in chrome. never use that shit !!
  • 7
    @Cyanide

    Sure it starts with "just a padding", three months later you're trying to figure out edge cases of copy-pasting commas from Samsung Smart Fridge.
  • 3
    Just use type="tel"
  • 1
    It gets a similar keyboard on mobile as well
  • 0
    @msdsk Its all fun and games until you have to explain to the customer why they can enter "1e2" as a valid number to a type="number" field. 😁
  • 1
    All that new HTML5 field types would be pretty awesome if you could just define them to be in the same language and use the same formats as the page.

    Input fields are part of the page. It looks pretty sloppy when they display stuff in a different language or format.

    I myself install all software in English despite that not being one of my local languages.
    When i visit local sites, it always looks like the web dev botched it when i see mixed-up number formats - despite me knowing the cause.
  • 1
    @arekxv
    Now that is easy to explain in as much detail as needed till they stop asking.

    But try explaining to them, why currency values pasted from Excel become huge integral numbers - that is bad UX they really care about.
  • 1
    @rEaL-jAsE still broken

    When you scroll numbers change and it cannot be disabled. We had more than a hundred support requests. People try to scroll the page but nouse over that box, number changes, they manage to scroll and save. Then they open ticket that system changed thier numbers. Dumb clients ? Maybe, but you work with them. So we banned all type=number in our app, complains went away

    It doesnt correctly manage "." and "," separators.

    (I'm using edge btw)
Add Comment