fix: ignore declaration tags for animation directive (#18366)

Fixes #18365
pull/18367/head
Simon H 3 months ago committed by GitHub
parent 85dcb91f7c
commit 1b4c43b8e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: ignore declaration tags for animation directive

@ -100,6 +100,7 @@ export function validate_element(node, context) {
(n) =>
n.type !== 'Comment' &&
n.type !== 'ConstTag' &&
n.type !== 'DeclarationTag' &&
(n.type !== 'Text' || n.data.trim() !== '')
).length > 1
) {

@ -0,0 +1,10 @@
<script>
function flip(){}
</script>
<div>
{#each [] as n (n)}
{const a = n}
<div animate:flip={a}></div>
{/each}
</div>
Loading…
Cancel
Save