-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to group radio buttons / checkboxes within sub-headings #1266
Ability to group radio buttons / checkboxes within sub-headings #1266
Conversation
Can we add a Heroku deployment please? I've added a new radios/checkboxes with subheadings demo to the form examples page. Thanks |
0b483a9
to
aeb01c0
Compare
aeb01c0
to
1c73bc6
Compare
Pushing again, looks like I got auto-cancelled:
|
Thanks for the deployment @hannalaakso. @frankieroberto I've added the radios/checkboxes within subheadings examples here: |
1c73bc6
to
3012dfb
Compare
As mentioned by @frankieroberto, I'll still need an alternative to #1163 otherwise open conditional reveals won't close when another group's radio is clicked. I'll take a look at this today. |
3012dfb
to
4377115
Compare
I've just added an alternative fix to #1163. This adds support for "Conditional reveal across sibling form groups" Looks like the final piece required for #1079 (including #1166 solved via It scopes radio events a little higher so we support: The default (as it works now) .govuk-fieldset input[type="radio"] Form group .govuk-form-group input[type="radio"] Form group with nested form groups .govuk-form-group .govuk-form-group input[type="radio"] |
4377115
to
c5c0e29
Compare
Initial testing in IE8–11 for the "Conditional reveal across sibling form groups" feature works great |
c5c0e29
to
244bf2e
Compare
244bf2e
to
4b152c4
Compare
Just added |
Firstly, we would like to thank you for submitting this PR and for the tremendous amount of work that you have put into this PR. Until a decision is made we won't be requiring anything more from you and we'll keep you updated as to the progress. |
Thanks @aliuk2012. I appreciate there are three distinct pieces of work you might want me to separate out:
We can do all or any of these in isolation. See what you think at the working group. |
Rebased with |
Hi @colinrotherham, Just a quick update, we were reviewing what we were going to take to the working group this week and we have decided not to take this pattern to the working group. The reason is we do not feel like this would be a good pattern to introduce and there are a lot of usability issues with it. Regarding the other changes you have proposed in this PR, we still think that they might still be worth merging but we need to discuss this as a team. Until a decision is made we won't be requiring anything more from you and we'll keep you updated as to the progress. |
87f97b3
to
5f2a8eb
Compare
@aliuk2012 Ah no problem. I appreciate this pattern confuses the One thing per page approach, and it's more applicable to our staff-facing systems so we can replicate it there instead. The other tidy-up changesI've removed the new pattern commits, and pushed the other changes here: #1281 |
5f2a8eb
to
370b427
Compare
Rebased with |
Provides the following: 1. govukLabel() 2. govukHint() 3. govukErrorMessage() With optional nested govukFieldset() via params.fieldset
Adds new examples 1. Group of multiple radio fieldsets 2. Group of multiple checkbox fieldsets Fixes alphagov#1079
370b427
to
5e5f565
Compare
We are closing this PR as it was decided that this pattern had a lot of usability issues but we are still considering the other work that @colinrotherham has done but the additional work has now been split out into two separate PR (#1281, #1297) |
This feature adds a new macro
govukFormGroup()
.This lets us put radios/checkboxes inside a
<div class="govuk-form-group">
wrapper, nested to multiple levels with thedescribedBy
variable to be persisted and appended to at each level.It also allows the component examples to show both regular and fieldset-wrapped variations using the optional
params.fieldset
, useful to confirm bugs like #1264Why else is it needed?
I've also addressed what looks like a bit of technical debt.
Duplicated inside almost all form control macros is Nunjucks code to generate a
govukLabel()
label, agovukHint()
hint an agovukErrorMessage()
error message.This code here is pretty much copy and pasted 7 times:
It's used by textarea, select, radios, checkboxes, text input, file upload and date input.
All this boilerplate code is now handled by
govukFormGroup()
.