Skip to content

Commit 91537c8

Browse files
committed
fix: don't set el for cached text nodes
1 parent 6cd3e1f commit 91537c8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/runtime-core/src/renderer.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2496,7 +2496,11 @@ export function traverseStaticChildren(
24962496
traverseStaticChildren(c1, c2)
24972497
}
24982498
// #6852 also inherit for text nodes
2499-
if (c2.type === Text) {
2499+
if (
2500+
c2.type === Text &&
2501+
// avoid cached text nodes retaining detached dom nodes
2502+
c2.patchFlag !== PatchFlags.CACHED
2503+
) {
25002504
c2.el = c1.el
25012505
}
25022506
// #2324 also inherit for comment nodes, but not placeholders (e.g. v-if which

0 commit comments

Comments
 (0)