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

Checkboxes within components don't work with bind:group #5029

Closed
arggh opened this issue Jun 16, 2020 · 1 comment
Closed

Checkboxes within components don't work with bind:group #5029

arggh opened this issue Jun 16, 2020 · 1 comment

Comments

@arggh
Copy link
Contributor

arggh commented Jun 16, 2020

Describe the bug

Enclosing inputs of type checkbox within components (let's call them toggles) will break, when using the group binding:

<script>
	export let group;
	export let value;
</script>

<label>
	<input type="checkbox" bind:group {value}/>
	<slot></slot>	
</label>

When using this component instead of plain inputs, only one value can be selected.

To Reproduce

https://svelte.dev/repl/b81ce8c9051e4f36ada03d36370a4ceb?version=3.23.2

Expected behavior
I would expect to be able to select multiple checkboxes and the underlying array to hold the selected values.

Information about your Svelte project:

  • Your browser and the version: Chrome latest

  • Your operating system: Mac OS Mojave

  • Svelte version: 3.23.2

Severity

Severe.

@Conduitry
Copy link
Member

This sounds like a duplicate of #2308.

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