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

Stop recommending using pattern="[0-9]*" on number inputs #2323

Merged
merged 2 commits into from
Aug 19, 2022

Conversation

36degrees
Copy link
Contributor

We previously recommended using pattern="[0-9]*" on number inputs to prompt iOS to display the numeric keypad.

This has been unnecessary since Safari 12.2, when support for the standardised inputmode attribute was added to Safari.

We stopped using the pattern attribute on the date input component in v4.1.0 (released in May 2022) as the proportion of GOV.UK visitors using versions of iOS 12.x and below had fallen to 0.08% of total traffic.

@36degrees 36degrees changed the title Remove pattern attribute numbers Stop recommending using pattern="[0-9]*" on number inputs Aug 19, 2022
@netlify
Copy link

netlify bot commented Aug 19, 2022

You can preview this change here:

Name Link
🔨 Latest commit 62aead4
🔍 Latest deploy log https://app.netlify.com/sites/govuk-design-system-preview/deploys/62ffb1f753398d0008e5cf14
😎 Deploy Preview https://deploy-preview-2323--govuk-design-system-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

36degrees and others added 2 commits August 19, 2022 16:53
We previously recommended using `pattern="[0-9]*"` on number inputs to prompt iOS to display the numeric keypad.

This has been unnecessary since Safari 12.2, when support for the standardised `inputmode` attribute was added to Safari.

We stopped using the `pattern` attribute on the date input component [1] in v4.1.0 (released in May 2022) as the proportion of GOV.UK visitors using versions of iOS 12.x and below had fallen to 0.08% of total traffic.

[1]: alphagov/govuk-frontend#2599

Co-authored-by: Calvin Lau <77630796+calvin-lau-sig7@users.noreply.github.com>
See previous commit for details.
@36degrees 36degrees force-pushed the remove-pattern-attribute-numbers branch from 130c31f to 62aead4 Compare August 19, 2022 15:53
@36degrees 36degrees merged commit e0a19a0 into main Aug 19, 2022
@36degrees 36degrees deleted the remove-pattern-attribute-numbers branch August 19, 2022 16:37
gtvj added a commit to govuk-one-login/authentication-frontend that referenced this pull request Aug 26, 2022
This update reflects a recent change to GOV.UK Design System
recommendations for using pattern attributes on number inputs.
The Design System update is described at:

alphagov/govuk-design-system#2323
gtvj added a commit to govuk-one-login/authentication-frontend that referenced this pull request Aug 26, 2022
This update reflects a recent change to GOV.UK Design System
recommendations for using pattern attributes on number inputs.
The Design System update is described at:

alphagov/govuk-design-system#2323
gtvj added a commit to govuk-one-login/di-account-management-frontend that referenced this pull request Aug 26, 2022
This update reflects a recent change to GOV.UK Design System
recommendations for using pattern attributes on number inputs.
The Design System update is described at:

alphagov/govuk-design-system#2323
36degrees added a commit that referenced this pull request Sep 12, 2022
We stopped recommending using the `pattern` attribute on number inputs in #2323 but I missed this reference in the guidance for the text input component and the bank details pattern.

We still tell users to turn off HTML validation in the broader 'question pages' pattern – that hasn't changed – but now that we're not using the pattern attribute there's no need to call it out in these specific places.
36degrees added a commit that referenced this pull request Sep 12, 2022
We stopped recommending using the `pattern` attribute on number inputs in #2323 but I missed this reference in the guidance for the text input component and the bank details pattern.

We still tell users to turn off HTML validation in the broader 'validation' pattern – that hasn't changed – but now that we're not using the pattern attribute there's no need to call it out in these specific places.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants