Conversation
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.
|
@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 |




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.