Skip to content

Svelte 5: bind:group incorrectly considers other groups when changing value #9947

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

Closed
ciscoheat opened this issue Dec 17, 2023 · 1 comment · Fixed by #10368 or #10410
Closed

Svelte 5: bind:group incorrectly considers other groups when changing value #9947

ciscoheat opened this issue Dec 17, 2023 · 1 comment · Fixed by #10368 or #10410
Labels
Milestone

Comments

@ciscoheat
Copy link

Describe the bug

When using bind:group on a store with nested data, previous groups are taken into account, returning an incorrect value when updating the store. This worked fine in Svelte 4.

I tracked the error to the functions bind_group and get_binding_group_value in render.js, where it seems like all groups are concatenated into one, which will be used in the latter function.

Reproduction

Svelte 5 preview site

  1. Uncheck "Mint choc chip" checkbox
  2. Current flavours will change to "1" (expected an empty array)
  3. Check it again, Mint choc chip will be added after the 1

Logs

No response

System Info

Svelte 5 preview site.

Severity

blocking an upgrade

@ciscoheat
Copy link
Author

Any news on this? It's basically what stops Superforms from working in Svelte 5, so it would be great it it was fixed.

dummdidumm added a commit that referenced this issue Feb 1, 2024
- Previously, any each block parents where used as keys for the sub group. That's wrong, it should only be using each blocks whos declarations contribute to the `bind:group` expression. Fixes #10345
- Only the left-most identifier of the expression was used to determine the binding group. This is wrong, all identifiers within the expression need to be taken into account. Fixes #9947
dummdidumm added a commit that referenced this issue Feb 1, 2024
- Previously, any each block parents where used as keys for the sub group. That's wrong, it should only be using each blocks whos declarations contribute to the `bind:group` expression. Fixes #10345
- Only the left-most identifier of the expression was used to determine the binding group. This is wrong, all identifiers within the expression need to be taken into account. Fixes #9947
@dummdidumm dummdidumm added the bug label Feb 1, 2024
@dummdidumm dummdidumm added this to the 5.0 milestone Feb 1, 2024
dummdidumm added a commit that referenced this issue Feb 6, 2024
dummdidumm added a commit that referenced this issue Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants