-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for each-blocks preventing outros from completing
Unkeyed each blocks end up with trailing `null` values that prevent the whole from being outroed. This fixes it so the null values are removed before outroing the remaining blocks. Fixes #1617
- Loading branch information
Showing
4 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
test/runtime/samples/transition-js-nested-each-delete/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
export default { | ||
nestedTransitions: true, | ||
skipIntroByDefault: true, | ||
|
||
data: { | ||
visible: true, | ||
things: [ 'a', 'b', 'c' ] | ||
}, | ||
|
||
test ( assert, component, target, window, raf ) { | ||
assert.htmlEqual(target.innerHTML, ` | ||
<div>a</div> | ||
<div>b</div> | ||
<div>c</div> | ||
`); | ||
|
||
component.set({ things: [ 'a' ] }); | ||
|
||
raf.tick( 100 ); | ||
assert.htmlEqual(target.innerHTML, ` | ||
<div>a</div> | ||
`); | ||
|
||
component.set({ visible: false }); | ||
|
||
raf.tick( 200 ); | ||
assert.htmlEqual(target.innerHTML, ''); | ||
} | ||
}; |
20 changes: 20 additions & 0 deletions
20
test/runtime/samples/transition-js-nested-each-delete/main.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{#if visible} | ||
{#each things as thing} | ||
<div transition:foo>{thing}</div> | ||
{/each} | ||
{/if} | ||
|
||
<script> | ||
export default { | ||
transitions: { | ||
foo(node, params) { | ||
return { | ||
duration: 100, | ||
tick: t => { | ||
node.foo = t; | ||
} | ||
}; | ||
} | ||
} | ||
}; | ||
</script> |