Skip to content

Commit 4aae9a7

Browse files
authored
Merge pull request #764 from sveltejs/gh-762
call create() on new iterations of static each blocks
2 parents dff1cb5 + 1f5f960 commit 4aae9a7

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

src/generators/dom/visitors/EachBlock.ts

+1
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ function unkeyed(
439439
`
440440
: deindent`
441441
${iterations}[#i] = ${create_each_block}( ${params}, ${each_block_value}, ${each_block_value}[#i], #i, #component );
442+
${iterations}[#i].create();
442443
${iterations}[#i].${mountOrIntro}( ${parentNode}, ${anchor} );
443444
`;
444445

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export default {
2+
data: {
3+
items: []
4+
},
5+
6+
html: ``,
7+
8+
test (assert, component, target) {
9+
component.set({ items: ['x'] });
10+
assert.htmlEqual(target.innerHTML, `foo`);
11+
}
12+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{{#each items as item}}
2+
foo
3+
{{/each}}

0 commit comments

Comments
 (0)