Skip to content

Commit

Permalink
Indent HTML for Select
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Jan 25, 2024
1 parent 739a857 commit a3cc0b2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/govuk-frontend/src/govuk/components/select/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@
{%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
{% for item in params.items %}
{% if item %}
{# Allow selecting by text content (the value for an option when no value attribute is specified) #}
{% set effectiveValue = item.value | default(item.text) %}
<option {%- if item.value !== undefined %} value="{{ item.value }}"{% endif %}
{{-" selected" if item.selected | default((effectiveValue == params.value and item.selected != false) if params.value else false, true) }}
{{-" disabled" if item.disabled }}
{%- for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>{{ item.text }}</option>
{#- Allow selecting by text content (the value for an option when no value attribute is specified) #}
{%- set effectiveValue = item.value | default(item.text) %}
<option {%- if item.value !== undefined %} value="{{ item.value }}"{% endif %}
{{-" selected" if item.selected | default((effectiveValue == params.value and item.selected != false) if params.value else false, true) }}
{{-" disabled" if item.disabled }}
{%- for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>{{ item.text }}</option>
{% endif %}
{% endfor %}
</select>
Expand Down

0 comments on commit a3cc0b2

Please sign in to comment.