diff --git a/CHANGELOG.md b/CHANGELOG.md index 7110c3eb4f..8ffcae86ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,12 @@ ([PR #1265](https://github.com/alphagov/govuk-frontend/pull/1265)) +- Prevent wrapping of individual date inputs + + Date inputs should group together as if they're a single field, this fix keeps them together using `white-space: nowrap`. + + ([PR #1257](https://github.com/alphagov/govuk-frontend/pull/1257)) + ## 2.9.0 (Feature release) 🆕 New features: diff --git a/src/components/date-input/_date-input.scss b/src/components/date-input/_date-input.scss index 642c45688a..cac1a29922 100644 --- a/src/components/date-input/_date-input.scss +++ b/src/components/date-input/_date-input.scss @@ -12,14 +12,18 @@ @include govuk-clearfix; // font-size: 0 removes whitespace caused by inline-block font-size: 0; + white-space: nowrap; } .govuk-date-input__item { display: inline-block; - margin-right: govuk-spacing(4); margin-bottom: 0; } + .govuk-date-input__item + .govuk-date-input__item { + margin-left: govuk-spacing(4); + } + .govuk-date-input__label { display: block; }