-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
function bindings error with bind:group #14670
Comments
This is expected - It is very likely possible to expose a getter/setter pair for consumption within |
getting this error
|
You can do this |
I am already doing this. |
This is related to using a workaround with own object with getter and setter. I'm trying a workaround to replace
Playground reproduction The example also has a radios binding, pls ignore. <script>
let checkboxesSelected = $state([]);
let checkboxes = {
get selected() {
return checkboxesSelected;
},
set selected(v) {
console.log(v);
checkboxesSelected = v;
}
}
</script>
<div>
<h3>Checkboxes</h3>
{#each ['cookies and cream', 'mint choc chip', 'raspberry ripple'] as flavor}
<label>
<input
type="checkbox"
name="flavors"
value={flavor}
bind:group={checkboxes.selected}
/>
{flavor}
</label>
{/each}
<pre>{JSON.stringify(checkboxesSelected, null, 2)}</pre>
</div> UPDATESetting the selected checkbox state to However, outside of |
Describe the bug
Function bindings not working with bind:group whether it's radio buttons or components
Reproduction
repl
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: