From 6deb199f1bceecc8d9e7fb171b75769da94f3071 Mon Sep 17 00:00:00 2001 From: Andy Mantell <134642+andymantell@users.noreply.github.com> Date: Thu, 26 Nov 2020 12:39:04 +0000 Subject: [PATCH 1/5] Fix invalid legend on the checkbox component's 'fieldset params' example --- src/govuk/components/checkboxes/checkboxes.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/govuk/components/checkboxes/checkboxes.yaml b/src/govuk/components/checkboxes/checkboxes.yaml index aef58c6fcf..f4063d1815 100644 --- a/src/govuk/components/checkboxes/checkboxes.yaml +++ b/src/govuk/components/checkboxes/checkboxes.yaml @@ -710,9 +710,9 @@ examples: name: example-name errorMessage: text: Please select an option - legend: - text: What is your nationality? fieldset: + legend: + text: What is your nationality? classes: app-fieldset--custom-modifier attributes: data-attribute: value From d824b009a22839daf5f9a61b8dcd30ea681320d7 Mon Sep 17 00:00:00 2001 From: Andy Mantell <134642+andymantell@users.noreply.github.com> Date: Thu, 26 Nov 2020 12:41:50 +0000 Subject: [PATCH 2/5] Mark 'value' as required under each option of a select component Omitting this value causes the select to output empty values against each item and so it should be marked as required. Also fixed a couple of the examples to comply with the above. --- src/govuk/components/select/select.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/govuk/components/select/select.yaml b/src/govuk/components/select/select.yaml index 0865c9ec39..158216a648 100644 --- a/src/govuk/components/select/select.yaml +++ b/src/govuk/components/select/select.yaml @@ -14,7 +14,7 @@ params: params: - name: value type: string - required: false + required: true description: Value for the option item. - name: text type: string @@ -205,11 +205,13 @@ examples: items: - text: Option 1 + value: 1 attributes: data-attribute: ABC data-second-attribute: DEF - text: Option 2 + value: 2 attributes: data-attribute: GHI data-second-attribute: JKL @@ -221,11 +223,13 @@ examples: items: - text: Option 1 + value: 1 - null - false - "" - text: Options 2 + value: 2 - name: hint hidden: true data: From 5ce3905bfba6a6e18980b4b54c49b37333543035 Mon Sep 17 00:00:00 2001 From: Andy Mantell <134642+andymantell@users.noreply.github.com> Date: Thu, 26 Nov 2020 13:22:53 +0000 Subject: [PATCH 3/5] Update jest snapshot for tweaked checkboxes example See 6deb199f1bceecc8d9e7fb171b75769da94f3071 --- .../components/checkboxes/__snapshots__/template.test.js.snap | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/govuk/components/checkboxes/__snapshots__/template.test.js.snap b/src/govuk/components/checkboxes/__snapshots__/template.test.js.snap index e877b82de6..1f410705f4 100644 --- a/src/govuk/components/checkboxes/__snapshots__/template.test.js.snap +++ b/src/govuk/components/checkboxes/__snapshots__/template.test.js.snap @@ -6,6 +6,9 @@ exports[`Checkboxes nested dependant components passes through fieldset params w data-attribute="value" data-second-attribute="second-value" > + + What is your nationality? + `; From 9a6eb482ebf582aa5ff6ac8d02975c729f9e8172 Mon Sep 17 00:00:00 2001 From: Andy Mantell <134642+andymantell@users.noreply.github.com> Date: Thu, 26 Nov 2020 14:25:19 +0000 Subject: [PATCH 4/5] Add missing value to checkboxes multiple hints example --- src/govuk/components/checkboxes/checkboxes.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/govuk/components/checkboxes/checkboxes.yaml b/src/govuk/components/checkboxes/checkboxes.yaml index f4063d1815..58526709ee 100644 --- a/src/govuk/components/checkboxes/checkboxes.yaml +++ b/src/govuk/components/checkboxes/checkboxes.yaml @@ -658,7 +658,8 @@ examples: text: Hint for british option here - value: irish text: Irish - - hint: + - value: other + hint: text: Hint for other option here - name: with error message and hint hidden: true From beb0e6da17f392e0c9ecf2876cf8dfa9d2fd02c7 Mon Sep 17 00:00:00 2001 From: Andy Mantell <134642+andymantell@users.noreply.github.com> Date: Mon, 14 Dec 2020 16:56:48 +0000 Subject: [PATCH 5/5] Unmark select component option values as required Followup to d824b009a22839daf5f9a61b8dcd30ea681320d7 and feedback on corresponding pull request (https://github.com/alphagov/govuk-frontend/pull/2043) --- src/govuk/components/select/select.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/govuk/components/select/select.yaml b/src/govuk/components/select/select.yaml index 158216a648..f1e07cf801 100644 --- a/src/govuk/components/select/select.yaml +++ b/src/govuk/components/select/select.yaml @@ -14,7 +14,7 @@ params: params: - name: value type: string - required: true + required: false description: Value for the option item. - name: text type: string