Skip to content

Commit

Permalink
Document in CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
igloosi committed Aug 30, 2018
1 parent 01774cd commit a14c7c1
Showing 1 changed file with 36 additions and 4 deletions.
40 changes: 36 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,45 @@

💥 Breaking changes:

- Pull Request Title goes here
- Remove name-based width logic from date-input component

Description goes here (optional)
In [1.1 release](https://github.com/alphagov/govuk-frontend/pull/857/files#diff-e94394b2ac1d4f73991af98e4fa34fa3L32) we removed styling which made the year field 4 characters wide, but was coupled to the field's name.

To migrate you need to change: X
However, to avoid making this a breaking release, we added logic to automatically add the width classes based on the name.

([PR #N](https://github.com/alphagov/govuk-frontend/pull/N))
We are now removing this behaviour. Instead, users need pass explicit classes for each field in the `items` object for the desired width of the input field

If you are using the Nunjucks macro, you need to provide a width class for each
item. Example
```
{{ govukDateInput({
"id": "dob",
"name": "dob",
"fieldset": {
"legend": {
"text": "What is your date of birth?"
}
},
"items": [
{
"name": "day",
"classes": "govuk-input--width-2"
},
{
"name": "month",
"classes": "govuk-input--width-2"
},
{
"name": "year",
"classes": "govuk-input--width-4"
}
]
}) }}
```
If you are using plain HTML, you need to manualy add a width-based class, such as
`govuk-input--width-2` or `govuk-input--width-4` to the input fields.

([PR #969](https://github.com/alphagov/govuk-frontend/pull/969))

🆕 New features:

Expand Down

0 comments on commit a14c7c1

Please sign in to comment.