Skip to content

Components in each-blocks with two-way binding don't always update #356

@Rich-Harris

Description

@Rich-Harris

This works...

{{#each a as b}}
	<Widget value='{{b}}'/>
{{/each}}

...but this doesn't:

{{#each a as b}}
	<Widget bind:value='b'/>
{{/each}}

Reason is the discrepancy between this code and this code — in the first case Svelte is checking if the dependencies of b (i.e. ['a']) are among the changed data properties, in the second case it's checking if b itself is among them (which of course it isn't).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions