Skip to content

Commit

Permalink
Add default message
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-ju committed Oct 9, 2018
1 parent 2c3a5f0 commit 7b534bf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ exports[`Character count when it includes a hint renders with hint 1`] = `
>
It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’.
</span>
<span id="character-count-with-hint-info"
class="govuk-hint govuk-character-count__message"
aria-live="polite"
>
You can enter up to characters
</span>
`;

Expand Down
1 change: 1 addition & 0 deletions src/components/character-count/_character-count.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

@include govuk-exports("govuk/component/character-count") {
.govuk-character-count {
.govuk-form-group,
.govuk-textarea {
margin-bottom: govuk-spacing(1);
}
Expand Down
3 changes: 3 additions & 0 deletions src/components/character-count/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@
errorMessage: params.errorMessage,
attributes: params.attributes
}) }}
<span id="{{ params.id }}-info" class="govuk-hint govuk-character-count__message" aria-live="polite">
You can enter up to {{ params.maxlength or params.maxwords }} {{'words' if params.maxwords else 'characters' }}
</span>
</div>

0 comments on commit 7b534bf

Please sign in to comment.