Live data from Hacker News

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

technology.blog.gov.uk

71–80 of 177 posts

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

#71
post #64

Earlier quoted context omitted.

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

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 litmus test is whether you can subtract values. The difference between two times, or two dates, or two temperature readings is something that is meaningful and commonly used in everyday life. The difference between two ZIP codes is nonsensical.

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

#72

Using "numeric" types for strings that look like base 10 numbers is an incredibly common mistake. It's one of those mistakes that works 99% of the time, which means it can become deeply embedded in architectures. We've recently seen this problem when a database for the first time for a non-numeric system in its ids and downstream systems that converted that to an integer started to fail. My rule of thumb is that if i…

They were using it to get a numeric entry pad on mobile devices because users preferred that. They knew the types weren't "numbers". Now that inputmode=”numeric” has better browser support they recommend that.

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

#73
post #64

Earlier quoted context omitted.

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

you can add farenheihts or celcius.

Yeah, it's 5°C warmer than it was yesterday.

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

#74
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…

Too bad the post office wasn't aware of space-filling curves when they started assigning regions :)

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

#75

This is off-topic, but I really like the current GOV.UK (several years old now). I don't really have opinions on the visual stuff, but I find it really pleasant to use. Filing my self-assessment tax return (only required because I run a side-business) is a fantastically straightforward experience. Step-by-step information entry, pre-filled with what they already know (e.g. main employer's salary), then they give you…

Fantastically straight forward? I strongly disagree. I've done the SA many times, and trying to find out your balance or payments list or anything useful is now a kafka-esque nightmare. Last time I knew they must owe me money but they didn't say at the end, and it took me about 15 minutes to find out how much, with no indication of when it would arrive. At the end of the SA they even had some sort of message saying m…

I’m biased, I used to work at GDS.

The lack of a ‘login’ button is a huge issue IMHO, but the main blocker to it isn’t the tech teams, its at the ministerial/senior civil service level.

The problem isn’t the button itself but the infrastructure behind it. I.e. it requires a single database of users (i.e. a national register of citizens).

This needs doing, but politicians come out in hives because it involves setting up a system similar to national ID cards (politically difficult). Senior civil servants dislike it because its a question of which department owns it, if its GDS its the cabinet office, and that means the Home Office, DWP, HMRC surrendering some control (i.e. being increasingly dependent on external systems), which is something departments seem to dislike.

It’d save millions (billions probably) in the long run, but there isn’t the political will to do it. It would need an influential cabinet minister to push it through and would take 3-5 years to get properly embedded.

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

#77
post #4

In summary the main issue is that, according to the spec, ` ` is only for numbers that are going to be parsed into a Javascript number. It has to make sense to increment, decrement or do other numerical operations on it. It's not to be used for strings or identifiers that just so happen to be numbers, e.g. credit card numbers. I'll admit this is slightly surprising to me but it does make a certain amount of sense. Th…

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!

Also sites that accept a 07/21 expiration date but not 7/21. Even worse if they accept it but then say it's an invalid card.

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

#78
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…

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

lingscars.com ?

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

#79
for things that are like telephone numbers and not like quantities is such a common mistake. It can be hilarious when, for example, a login form uses such a field for a Swedish personal identity number. I just need to click the up arrow ~1.996×10¹¹ times!

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

#80
post #4

In summary the main issue is that, according to the spec, ` ` is only for numbers that are going to be parsed into a Javascript number. It has to make sense to increment, decrement or do other numerical operations on it. It's not to be used for strings or identifiers that just so happen to be numbers, e.g. credit card numbers. I'll admit this is slightly surprising to me but it does make a certain amount of sense. Th…

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!

I hate it when they have drop-down menu for entering your year of birth, so the older you are, the further you have to scroll, but only infants and toddlers can select the year they were born without scrolling.

A non-numeric text field is so much easier, and you should also be able enter your birth year as Roman numerals (which is even easier for millennials).

Post reply on HN