Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Commit

Permalink
[#PAB-508]: add scrollable checkboxes
Browse files Browse the repository at this point in the history
..

..
  • Loading branch information
Joel-Pearce committed Jul 28, 2023
1 parent ebb9f1b commit 27ad11a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
5 changes: 5 additions & 0 deletions app/static/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,8 @@
padding-bottom: 40px;
}
}

.scrollable-checkboxes {
max-height: 250px;
overflow-y: auto;
}
24 changes: 13 additions & 11 deletions app/templates/main/checkboxes.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
{% macro checkboxItems(name, items) %}
<div class="govuk-form-group">
<fieldset class="govuk-fieldset" aria-describedby="">
<div class="govuk-checkboxes" data-module="govuk-checkboxes">
{% for item in items %}
{% if item %}
<div class="govuk-checkboxes__item">
<input class="govuk-checkboxes__input" id="{{ name }}-{{ item['id'] }}" name="{{ name }}" type="checkbox"
value="{{ item['id'] }}">
<label class="govuk-label govuk-checkboxes__label" for="{{ name }}-{{ item['id'] }}">
{{ item['name'] }}
</label>
<div class="scrollable-checkboxes">
<div class="govuk-checkboxes" data-module="govuk-checkboxes">
{% for item in items %}
{% if item %}
<div class="govuk-checkboxes__item">
<input class="govuk-checkboxes__input" id="{{ name }}-{{ item['id'] }}" name="{{ name }}" type="checkbox"
value="{{ item['id'] }}">
<label class="govuk-label govuk-checkboxes__label" for="{{ name }}-{{ item['id'] }}">
{{ item['name'] }}
</label>
</div>
{%- endif -%}
{%- endfor -%}
</div>
{%- endif -%}
{%- endfor -%}
</div>
</fieldset>
</div>
Expand Down

0 comments on commit 27ad11a

Please sign in to comment.