Skip to content

Commit 021d602

Browse files
committed
Fix deep morphdom key bug
1 parent 7e636ec commit 021d602

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/morph/src/morph.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ export function morph(from, toHtml, options) {
147147
from.appendChild(holdover)
148148

149149
currentFrom = holdover
150+
fromKey = getKey(currentFrom)
150151
} else {
151152
if(! shouldSkip(adding, currentTo)) {
152153
// Add element...
@@ -256,6 +257,7 @@ export function morph(from, toHtml, options) {
256257
// No "from" key...
257258
currentFrom.replaceWith(fromKeys[toKey])
258259
currentFrom = fromKeys[toKey]
260+
fromKey = getKey(currentFrom)
259261
}
260262
}
261263

@@ -267,6 +269,7 @@ export function morph(from, toHtml, options) {
267269
fromKeyHoldovers[fromKey] = currentFrom
268270
currentFrom.replaceWith(fromKeyNode)
269271
currentFrom = fromKeyNode
272+
fromKey = getKey(currentFrom)
270273
} else {
271274
// Swap elements with keys...
272275
fromKeyHoldovers[fromKey] = currentFrom; // This ";" needs to be here...

0 commit comments

Comments
 (0)