diff --git a/CHANGELOG.md b/CHANGELOG.md index 063a0095e6..3bd1c4fb1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -73,6 +73,7 @@ We’ve made fixes to GOV.UK Frontend in the following pull requests: - [#2807: Tidy up and refactor the Character Count JavaScript](https://github.com/alphagov/govuk-frontend/pull/2807) - [#2811: Use Element.id to get module id for accordion](https://github.com/alphagov/govuk-frontend/pull/2811) +- [#2821: Avoid duplicated --error class on Character Count](https://github.com/alphagov/govuk-frontend/pull/2821) ## 4.3.1 (Patch release) diff --git a/src/govuk/components/character-count/template.njk b/src/govuk/components/character-count/template.njk index dd04e4dd53..d812a777ee 100644 --- a/src/govuk/components/character-count/template.njk +++ b/src/govuk/components/character-count/template.njk @@ -13,7 +13,7 @@ spellcheck: params.spellcheck, value: params.value, formGroup: params.formGroup, - classes: 'govuk-js-character-count' + (' govuk-textarea--error' if params.errorMessage) + (' ' + params.classes if params.classes), + classes: 'govuk-js-character-count' + (' ' + params.classes if params.classes), label: { html: params.label.html, text: params.label.text,