Live data from Hacker News

Why the Gov.uk Design System team changed the input type for numbers

technology.blog.gov.uk

131–140 of 177 posts

Re: Why the Gov.uk Design System team changed the input type for numbers

#131
post #48

Earlier quoted context omitted.

One good reason for this is that for things like credit card numbers, a good interface will accept leading, trailing, or interior spaces. Sites that make me type in values in exactly their own weird format are an abomination. Site A: Ah ah ah! You put a slash in your date! No soup for you! Site B: Ah ah ah! You didn't put a slash in your date! No soup for you!

That's one of the reasons I love Stripe's checkout being used everywhere and designers elsewhere basically copying them. The internet is constantly getting better and I don't think we give that progress we've made in web design over the last few decades enough credit. Just imagine how bad it used to be to just purchase a simple thing on an ecommerce site in the mid 2000s. Or remember what car websites used to look li…

It's interesting to see how many people take certain things in web design for granted. I'd be interested to know how many readers here were in the neighborhood of 10 or 12 years old in the mid 2000s.

We've reached a point where it seems like the amount of people who know react looks pretty close to the amount of people who know CSS. CSS wasn't even a thing when I built my first site, and now the phrase "web design" isn't even really in the vernacular today.

I'm not asking anybody to get off my lawn or anything, it's just interesting.

Re: Why the Gov.uk Design System team changed the input type for numbers

#132

Earlier quoted context omitted.

Seems to me like you're missing the point. They want to give their users a numeric keyboard but without the downsides of a numeric textfield. Your solution seems oblivious to their goals and TFA.

...at the risk of modified data? With things like credit card numbers? I think I'm just not chill enough for that.

[deleted]

Re: Why the Gov.uk Design System team changed the input type for numbers

#133

Earlier quoted context omitted.

To put it more succinctly and without unnecessarily referring to JavaScript semantics, type="number" is for quantities , not mere strings of digits . It's an unfortunate accident of the English language that both are commonly called ‘numbers’. We might not have had this confusion if some other language were the lingua franca of computing.

I mean, this could've been solved by the spec using type="quantity". Many languages have generic, ambiguous umbrella terms, it's the sloppiness of the spec picking one.

A sequence of numbers could be called, with a little approximation, a barcode. Which makes me wonder why credit cards don’t have an actual barcode to easily enter it on the computer.

Re: Why the Gov.uk Design System team changed the input type for numbers

#135
post #62

Earlier quoted context omitted.

Part of the problem is that inputs don't necessarily reflect the specific intent behind the use of certain symbols. For 99% of people using US keyboards when they input a dash in a credit card number they are using the exact same key as one would use for the minus when inputting a negative number. If you asked them to verbalize their inputs they would probably use different words for the same symbol, signifying that…

Not to mention that some countries use . as a decimal point and , as a digit grouping separator, and others do it the other way around.

Yes, I'm rather glad I haven't had to deal with localizing decimal inputs, just displaying them.

I have had to deal with localizing date inputs though. Ugh.

Re: Why the Gov.uk Design System team changed the input type for numbers

#136
post #105
post #78

Earlier quoted context omitted.

> Or remember what car websites used to look like vs what they look like now. lingscars.com ?

I love this website. Can anyone from the UK explain what a 'mutti-car' is?

The only way that makes sense to me, is that "mutti" is a short form of "mutter" in german, which means mother. So a "mom car".

Disclaimer: I'm not english, and only half german.

Re: Why the Gov.uk Design System team changed the input type for numbers

#137
post #110
post #105

Earlier quoted context omitted.

I love this website. Can anyone from the UK explain what a 'mutti-car' is?

No more than I can explain 'electrodreams' or 'mackem sex', I'm afraid!

A mackem is someone from Sunderland.

Re: Why the Gov.uk Design System team changed the input type for numbers

#138
post #71
post #64

Earlier quoted context omitted.

you can add farenheihts or celcius.

You can meaningfully add or subtract degrees to a temperature reading, but you can't meaningfully add two readings together (unless you're averaging them!). There's a subtlety here: A temperature difference is actually a different data type than a temperature . Dates and times have similar issues: You can add 2 hours to 3 hours, and you can add 2 hours to 3 o'clock, but you can't add 2 o'clock to 3 o'clock. A better…

> unless you're averaging them!

Nitpicking, but that seems like a great case for them being numbers. You will never average credit cards or zip codes. Averaging times is meaningful too (e.g. the mean arrival time).

I think op meant "adding" as generally doing math on them. Each quantity will have its own natural operations.

I see what you mean though, subtraction seems like a good heuristic by virtue of difference being mostly (always?) meaningful.

Re: Why the Gov.uk Design System team changed the input type for numbers

#140

Earlier quoted context omitted.

My general rule is if you can't add two values together then they shouldn't be represented as number types.

So a temperature is a number only as long as it's expressed in kelvins?

Perhaps you should take differences instead? Same with pointers. Their addition isn't meaningful, but their differences are.

In general, addition is only meaningful in linear systems, but differences can be meaningful in affine systems.

Post reply on HN