Conversation
|
@colinrotherham I’ve updated this (with some help from AI) so I think it’s a reviewable state now. I made one behavioural change which is that the “select all” checkbox becomes automatically checked if you individually check all the other checkboxes. |
|
One difference with the GOVUK implementation of this (which I originally wrote) is that that uses The advantage of the GOVUK one is that you can’t specify both inclusive and exclusive on same input! (Not that they support inclusive behaviour yet) We could either choose to align with the GOVUK version and switch to a |
|
|
@anandamaryon1 @colinrotherham @sarawilcox any chance we could review this for the next release? I think we have enough evidence that it would be useful?! (It's been designed into at least 2 vaccination services). |
|
Sorry for not replying on this one. It makes total sense. Did you get to run your user testing with it? I think we'd want to add guidance and an example in the design system too. Any insight as to why gov haven't added it? |
|
I've asked in the cross-gov Slack about it too. |
|
We tested the interface in #1707 (comment) in our last round of user research, with staff who use Record a vaccination across multiple pharmacies. We didn’t find any issues with the interaction. In our current prototype I’m always including the select-all option so long as there’s 2+ options (if there’s only a single option they skip the screen entirely). It might be that it only makes sense to include the select-all option if there are 5+ or some other number of options though. |
|
I'd like us to support We'd want backwards compatibility with our NHS specific But what about multiple inclusive groups—would we support these too? Multiple named groupsUnlike GOV.UK Frontend we also support multiple named groups via E.g. Try the 3 named exclusive groups:
Should we rename to |
|
@colinrotherham maybe initially we add this in a backwards-compatible way, by adding Then could consider switching to |
Fixes bug:
Bug: When an inclusive checkbox ("Select all") was unchecked with checkboxes that have unique names and use inclusiveGroup, the other checkboxes were not being unchecked because handleClick called unCheckAllInputsExcept() which uses checkboxExclusiveGroup instead of checkboxInclusiveGroup.
This updates the behaviour for inclusive ("select all") checkboxes, so that if you individually check all checkboxes except for "select all", then the "select all" checkbox gets automatically check when you check the last checkbox.
This avoids being in a state where "select all" is the only checkbox unchecked, and when you check it then nothing happens.
3315cf6 to
258360c
Compare
258360c to
0bf679b
Compare
0bf679b to
77d95e4
Compare
|
|
@frankieroberto I've had a go at deduplicating the spike code I added back in 70ee9ba
Rather than add new options, only to remove them later, I've pushed up changes to:
This gives us both |
|
@frankieroberto Also to discuss, whether we should hide "Select all" (or even "None of the above") without JS? |
|
Hi @frankieroberto, do we need something adding to the guidance in the design system about this? |
|
@colinrotherham I think it makes sense to not show the 'select all' checkbox where javascript is unavailable, and treat it as progressive enhancement? Otherwise, we'd have to infer that if someone ticked 'select all' but none (or only some) of the other checkboxes, which feels slightly risky? This is different from the 'none' checkbox, as that still has a benefit with no javascript - and we have some guidance suggesting showing an error if they selected both another checkbox and 'none':
|




This updates the Checkbox component with a new option for “select all” checkboxes, using
inclusive: truealongside the existing “none of the above” option which deselects all the others when checked.