alphagov / govuk_publishing_components

A gem to document and distribute frontend components for GOV.UK applications
https://components.publishing.service.gov.uk
MIT License
65 stars 20 forks source link

Date input component should allow errors on individual text inputs, e.g. just the day field #3510

Open floehopper opened 1 year ago

floehopper commented 1 year ago

The documentation for error messages on a Date Input says:

If you’re highlighting just one field - either the day, month or year - only style the field that has an error. The error message must say which field has an error, like this:

Screenshot 2023-07-20 at 12 13 26

However, the date_input component doesn't currently support this use case - you can have multiple error items, but they all have to refer to the component as a whole.

I'd be willing to open a PR for this if it's likely to be accepted...

jon-kirwan commented 1 year ago

Hi @floehopper, apologies for taking a while to respond. Thanks for submitting the issue. If you'd like to submit a PR, I'd be happy to review it. Also, there's a few docs in this repository that you may find useful when it comes to making changes, such as the guide on component conventions. Thanks, Jon.