Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider removing the pattern attribute from date input once traffic from iOS < 12.2+ drops off #1701

Closed
36degrees opened this issue Jan 17, 2020 · 4 comments · Fixed by #2599
Labels
date input 🕔 hours A well understood issue which we expect to take less than a day to resolve. small story
Milestone

Comments

@36degrees
Copy link
Contributor

What

We use the pattern attribute to force the inputs within the date input component to trigger a numeric keypad on iOS < 12.2+, (and possibly some older Android browsers?)

Why

Once the number of users that require the pattern attribute in order to trigger a numeric keypad has dropped to a low enough percentage, we can remove it and rely exclusively on inputmode.

@36degrees
Copy link
Contributor Author

iOS < 12.2 accounted for 1.37% of all iOS traffic in May 2021 – or 0.43% of all traffic – with 91.49% of iOS users running iOS 14.

@kellylee-gds kellylee-gds added the 🕔 hours A well understood issue which we expect to take less than a day to resolve. label Jul 6, 2021
@querkmachine
Copy link
Member

In March 2022, iOS versions 12.2 and below accounted for around 0.19% of iOS traffic and 0.08% of total traffic on GOV.UK.

@querkmachine
Copy link
Member

querkmachine commented Apr 22, 2022

Reasons to remove it:

  • It's largely redundant now that inputmode is supported by the vast majority of visitor's devices.
  • Having unnecessary code and tests in Frontend is undesirable from a maintenance perspective.
  • We're sending a few extra bytes down the wire where it probably isn't necessary.

Reasons to keep it:

  • It provides a better experience for the small number of users who still benefit from it.
  • The pattern attribute has client-side validation benefits (though I'm not sure if any services use it in this way).

Other notes:

  • As far as I can tell, the presence of inputmode or pattern doesn't change how the fields are announced by screen readers, nor limits what can be entered by voice control or dictation.

@36degrees
Copy link
Contributor Author

  • The pattern attribute has client-side validation benefits (though I'm not sure if any services use it in this way).

We currently tell people to turn off client-side (HTML5) validation, although it's a bit buried.

I think this might if anything be a reason to remove it. If service teams don't turn off HTML5 validation then this is one of the few attributes we use across the codebase which would trigger client-side validation, which isn't always that accessible or helpful ('Please match the requested format.')

On balance, I'd support removing it at this point 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
date input 🕔 hours A well understood issue which we expect to take less than a day to resolve. small story
Projects
Development

Successfully merging a pull request may close this issue.

3 participants