Skip to content

Commit 1b4c43b

Browse files
authored
fix: ignore declaration tags for animation directive (#18366)
Fixes #18365
1 parent 85dcb91 commit 1b4c43b

4 files changed

Lines changed: 17 additions & 0 deletions

File tree

‎.changeset/tangy-keys-drop.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: ignore declaration tags for animation directive

‎packages/svelte/src/compiler/phases/2-analyze/visitors/shared/element.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ export function validate_element(node, context) {
100100
(n) =>
101101
n.type !== 'Comment' &&
102102
n.type !== 'ConstTag' &&
103+
n.type !== 'DeclarationTag' &&
103104
(n.type !== 'Text' || n.data.trim() !== '')
104105
).length > 1
105106
) {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<script>
2+
function flip(){}
3+
</script>
4+
5+
<div>
6+
{#each [] as n (n)}
7+
{const a = n}
8+
<div animate:flip={a}></div>
9+
{/each}
10+
</div>

0 commit comments

Comments
 (0)