Live data from Hacker News

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

technology.blog.gov.uk

111–120 of 177 posts

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

#111

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!

> a good interface will accept leading, trailing, or interior spaces Won't pattern="[0-9]*" do the exact opposite of what you're suggesting?

It won't accept it.. in exactly the right way.

Because you can't enter spaces, they don't get submitted, and validation doesn't fail.

As long as they don't also do 'class="nopaste"' or whatever, we're golden!

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

#112

Earlier quoted context omitted.

> a good interface will accept leading, trailing, or interior spaces Won't pattern="[0-9]*" do the exact opposite of what you're suggesting?

Important to note that in the article we mention we only use pattern to trigger the right keyboard in old iOS. We actually turn off HTML validation in favour of doing server side validation, we'll soon be publishing guidance on that too. Disclaimer - I work on the team.

Disclosure* - you're claiming to be on the team, not disclaiming it.

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

#113
post #94
post #78

Earlier quoted context omitted.

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

This might be the best website ever. It is over the top, but the theme is consistent. It reminds me of a myspace page, but if someone just wanted to be ridiculous, not unsightly. Side note: anyone remember "I knows me some ugly myspace" from Ze Frank?

Ze Frank. Now there’s a name I haven’t heard in quite some time. What an early internet vlog pioneer. I wondered what happened to him and looked him up a while back. Turns out he’s some bigwig at BuzzFeed so I guess he made out okay, but part of me misses that early enthusiasm and wonder of early internet 2.0.

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

#114
post #52

Earlier quoted context omitted.

Indeed, that's a nice example. I felt the design could even improve public relations. If I were a UK citizen, I'd be relieved to find the information so well-designed and presented. I've read here and there about the UK Government Digital Service, and have a very good impression. Reading a recent related article, it sounds like they have their priorities right! https://gds.blog.gov.uk/2019/11/05/transforming-gov-uk-t…

The UK has long been an early adopter of proper web design for government websites. Seeing the average Canadian gov website, and hearing stories from people who've worked on some at the federal level, makes my head hurt.

The Canadian and provincial governments are getting better though. See the OSAP (Ontario Student Assistance Program) application page, which is fully mobile and vastly simplified from the hot mess it used to be. Also, just look at https://ontario.ca in general, which is clearly inspired by Gov.UK.

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

#115
post #83

Earlier quoted context omitted.

That's a good rule of thumb there :) More pedantically, credit card numbers _aren't_ numbers in the first place. They are identifiers that happen to use numerical digits. Same as phone numbers. Treating them as numbers at any point in a system is an error. My dream is this detail of the HTML spec forces people to rethink their schema design while they're at it.

See also: New England ZIP Codes, which can cause all kinds of problems.

To save a search for those who might not know off the top of their head - New England is home to leading zero ZIP codes (e.g. 02122 for Boston).

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

#116

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!

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).

Can’t you just type “1984” or “Alaska” while focused on the dropdown to select on modern browsers

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

#117
post #70

FYI, there's a few features available with the number input type that don't work with this method. Things like min, max and step attributes.

min, max, and step don't make sense for things like account numbers or credit cards!

Well yes, in those cases it doesn't make sense, but the article mentions things like date fields, where you might want a min of 1 and a max of 31. It can also make sense to use step="0.1" if you need value to include tenths.

Just saying there's advantages and disadvantages to each approach. I do agree with the article, their approach is better in most cases.

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

#118

Earlier quoted context omitted.

> a good interface will accept leading, trailing, or interior spaces Won't pattern="[0-9]*" do the exact opposite of what you're suggesting?

Important to note that in the article we mention we only use pattern to trigger the right keyboard in old iOS. We actually turn off HTML validation in favour of doing server side validation, we'll soon be publishing guidance on that too. Disclaimer - I work on the team.

Why are you going to server-side only? I've always held that client-side validation is important for UX as it provides instant feedback and doesn't need any extra work to preserve the other data that's already been input. Obviously the inputs still need to be validated on the server e.g. to protect against things that get past (or bypass) the client-side checks, or perform more expensive validation.

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

#119
post #85
post #75

Earlier quoted context omitted.

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…

Finding where to login for SA is the one frustration I have with SA right now. Everything else works really smoothly, but I have to resort to Googling "self assessment login" every time. Solving this doesn't require a unified login - it needs proper signposting within gov.uk of the most likely user flows. Right now, finding the login for SA is something like 5 levels deep within the hiearchy of pages, and even then i…

I get what you’re saying I have the same problem with SA, but the key is better personalisation, which login can help with.

Gov.uk provides hundreds of services, like SA, which each user will only use a small subset of. That subset will be different for each user. I now need SA whereas 5 years ago prominently signposting that would have been useless to me. For others education services, welfare services and health should be highlighted. All this is quite difficult without knowing who is accessing the site.

Though In the specific case of SA, I think its not as well conceived a service as it can be. 95% of the time i’m not ‘registering for self assessment’ or ‘filing a self assessment tax return’ , i’m ‘checking what tax i owe’

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

#120

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!

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).

Trying to change the system because millennials have it slightly easier than you is the most “ok boomer” thing I’ve seen today ;)
Post reply on HN