Skip to content

Commit

Permalink
Merge pull request #2693 from ONSdigital/fix/2351/checkboxeslebel-sho…
Browse files Browse the repository at this point in the history
…uld-not-be-required-for-nested-checkboxes

make checkboxeslabel not required for radios
  • Loading branch information
precious-onyenaucheya-ons authored Jun 26, 2023
2 parents 4a2fcf9 + b8b7178 commit 1a9d818
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/checkboxes/_macro-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
| legendClasses | string | false | Classes to add to the fieldset‘s legend |
| description | string | false | Hint text following the fieldset‘s legend to help users answer |
| attributes | object | false | HTML attributes (for example, data attributes) to add to the fieldset |
| checkboxesLabel | string | true | A prompt for the checkboxes, for example, “Select all that apply” |
| checkboxesLabel | string | true (unless inside a radio) | A prompt for the checkboxes, for example, “Select all that apply” |
| checkboxesLabelClasses | string | false | Classes to add to the checkboxes prompt element (`checkboxesLabel`) |
| checkboxes | array`<Checkbox>` | true | Settings for each [checkbox](#checkbox) |
| borderless | boolean | false | Set to “true” to remove the border surrounding the input and label |
Expand Down
2 changes: 2 additions & 0 deletions src/components/checkboxes/_macro.njk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
{% from "components/button/_macro.njk" import onsButton %}

{% set fields %}
{% if params.checkboxesLabel is defined %}
<p class="ons-checkboxes__label{{ " " + params.checkboxesLabelClasses if params.checkboxesLabelClasses }}">{{ params.checkboxesLabel }}</p>
{% endif %}
{% set hasOther = false %}
{% for checkbox in params.checkboxes %}
{% if checkbox.other %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
}) %}
{{
onsCheckboxes({
"checkboxesLabel": "Select all that apply",
"dontWrap": true,
"name": "central-heating",
"checkboxes": [
Expand Down

0 comments on commit 1a9d818

Please sign in to comment.