-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Multiple registers in each block with bind group and no index #5174
Comments
Actually it looks like adding the index variable to the #each expression (i.e. With the function get_each_context(ctx, list, i) {
const child_ctx = ctx.slice();
child_ctx[6] = list[i];
child_ctx[8] = i;
return child_ctx;
} And then in the inner each loop, it uses /*$$binding_groups*/ ctx[5][0][/*d*/ ctx[8]].push(input); Without the explicit index, Svelte is still generating an index internally and linking the bind group to it as before: /*$$binding_groups*/ ctx[5][0][/*day_index*/ ctx[8]].push(input); But function get_each_context(ctx, list, i) {
const child_ctx = ctx.slice();
child_ctx[6] = list[i];
return child_ctx;
} Looks to me like this line needs to add a condition that checks if there is an implicit index.
I haven't yet found the flag that indicates if it that implicit index exists or not. If nobody else gets to it first, I'll try to get a fix in later this week. |
This is fixed in 3.24.1 - https://svelte.dev/repl/6ee5960e75ac442bb0f8577f98941501?version=3.24.1 |
Describe the bug
Each loop register multiple values in
bind:group
, adding key expression doesn't help, but adding index strangely solves the problem.To Reproduce
Buggy: https://svelte.dev/repl/6ee5960e75ac442bb0f8577f98941501?version=3.24.0
Fixed: https://svelte.dev/repl/5738295d14a6406a9f4a1a0b73f403d0?version=3.24.0
Fixed version works without the keys
(key)
Expected behavior
Expected that key expression was the one to give each element unique id to bind the group
Information about your Svelte project:
Severity
How severe an issue is this bug to you? Is this annoying, blocking some users, blocking an upgrade or blocking your usage of Svelte entirely?
Annoying, time wasting
The text was updated successfully, but these errors were encountered: