Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/rotten-lizards-remember.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

fix: reuse already attached attachments from spread attributes
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,10 @@ export function set_attributes(element, prev, next, css_hash, skip_warning = fal
}

for (let symbol of Object.getOwnPropertySymbols(next)) {
if (symbol.description === ATTACHMENT_KEY) {
if (
symbol.description === ATTACHMENT_KEY &&
(prev == undefined || !(symbol in prev) || prev[symbol] !== next[symbol])
) {
attach(element, () => next[symbol]);
}
}
Expand Down