Skip to content

Commit

Permalink
Move Character count attributes to formGroup wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Mar 6, 2024
1 parent b2b0188 commit ee42acf
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@
}) -}}
{% endset -%}

<div class="govuk-character-count" {{- attributesHtml | safe }}>
{#- Append form group attributes onto attributes set above #}
{%- for name, value in params.formGroup.attributes %}
{% set attributesHtml = attributesHtml + " " + name | escape + '="' + value | escape + '"' %}
{% endfor -%}

<div class="govuk-character-count">
{{ govukTextarea({
id: params.id,
name: params.name,
Expand All @@ -95,7 +100,7 @@
value: params.value,
formGroup: {
classes: params.formGroup.classes,
attributes: params.formGroup.attributes,
attributes: attributesHtml,
beforeInput: params.formGroup.beforeInput,
afterInput: {
html: countMessageHtml
Expand Down

0 comments on commit ee42acf

Please sign in to comment.