Skip to content
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

Checkbox group: cannot preselect more than one option #231

Open
alina-lapina opened this issue Dec 9, 2020 · 1 comment
Open

Checkbox group: cannot preselect more than one option #231

alina-lapina opened this issue Dec 9, 2020 · 1 comment

Comments

@alina-lapina
Copy link

alina-lapina commented Dec 9, 2020

Describe the bug
Cannot (pre)select more that one option.

To Reproduce
Steps to reproduce the behavior:

<CheckboxGroup
	header="Header"
	onChange={() => callback}
	orientation="column"
	selectedValue="item2"
	items={[
		{ label: 'Checkbox 1', value: 'checkbox1' },
		{ label: 'Checkbox 2', value: 'checkbox2' },
		{ label: 'Checkbox 3', value: 'checkbox3', disabled: true },
	]}
/>

Expected behavior
It should be possible to preselect several options, because checkbox is meant to be collectively exhaustive, while input type=radio is mutually exclusive.
Each item in the group has to be responsible for its selection in the group: { label: '...', value: '...', selected: true/false },

<CheckboxGroup
	header="Header"
	onChange={() => callback}
	orientation="column"
	items={[
		{ label: 'Checkbox 1', value: 'checkbox1' },
		{ label: 'Checkbox 2', value: 'checkbox2', selected: true },
		{ label: 'Checkbox 3', value: 'checkbox3', disabled: true },
	]}
/>
@alina-lapina alina-lapina changed the title Checkbox group: several options are preselected Checkbox group: cannot preselect more than one option Dec 9, 2020
@ssb-cgn
Copy link
Contributor

ssb-cgn commented Jan 13, 2021

Har opprettet en sak på dette hos oss nå :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants