Skip to content

Commit

Permalink
Merge pull request #2303 from uktrade/LTD-5796-spans-to-labels
Browse files Browse the repository at this point in the history
Change span to label so for attribute works
  • Loading branch information
hnryjmes authored Jan 14, 2025
2 parents 4219b25 + 46dfb12 commit e240c68
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lite_forms/templates/components.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@
</label>
{% endif %}
{% if question.description %}
<span class="govuk-hint" for="{{ question.name }}">
<label class="govuk-hint" for="{{ question.name }}">
<span>{{ question.description|safe }}</span>
</span>
</label>
{% endif %}
{% if question.accessible_description %}
<span class="govuk-hint govuk-visually-hidden" for="{{ question.name }}">
<label class="govuk-hint govuk-visually-hidden" for="{{ question.name }}">
{{ question.accessible_description }}
</span>
</label>
{% endif %}

<!-- Error -->
{% if errors %}
{% if errors|key_value:question.name and question.input_type != "hidden" %}
<span id="error-{{ question.name }}" for="{{ question.name }}" class="govuk-error-message">
<span id="error-{{ question.name }}" class="govuk-error-message">
<span class="govuk-visually-hidden">Error:</span>
{% for error in errors|key_value:question.name %}
{{ error }}
Expand Down

0 comments on commit e240c68

Please sign in to comment.