Skip to content

Remove pattern="[0-9]*" from date inputs #259

Closed

Description

@frankieroberto

Currently the date inputs contain the pattern=[0-9]* attribute.

This was previously recommended in order to make mobile devices display the digit keyboard instead of the standard qwerty keyboard. However, inputmode="numeric" is now widely supported and a better way of achieving this.

pattern=[0-9]* causes a browser based validation message, which is not super accessible or well written. It can be turned off by adding the novalidate to the <form>, but people may forget to do this.

Given that pattern=[0-9]* is no longer included in the Date input in the NHS Design system, we should drop it from the React implementation too.

Activity

  1. frankieroberto commented on Nov 7, 2024

    @frankieroberto
    MemberAuthor

    @mikemonteith fancy doing this? 😄

  2. ozgurozbek commented on Aug 22, 2025

    @ozgurozbek

    Is this still an issue? I assume this is related to this 'pattern' using pattern = '[0-9]*'. Looks to be last updated when migrating to nhsuk-frontend v8 on Feb 29th.

  3. frankieroberto commented on Aug 22, 2025

    @frankieroberto
    MemberAuthor

    @ozgurozbek Yep, still needs to be done.

  4. colinrotherham commented on Sep 9, 2025

    @colinrotherham
    Collaborator

    This has been fixed in #267

    Behaviour now matches the date input component in NHS.UK frontend

  5. added this to the v6.0.0 milestone on Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions