From 021d60259067206c70a5608e72e2952882b13460 Mon Sep 17 00:00:00 2001 From: Caleb Porzio Date: Thu, 31 Oct 2024 17:10:40 -0400 Subject: [PATCH] Fix deep morphdom key bug --- packages/morph/src/morph.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/morph/src/morph.js b/packages/morph/src/morph.js index 00e33d88f..123467d30 100644 --- a/packages/morph/src/morph.js +++ b/packages/morph/src/morph.js @@ -147,6 +147,7 @@ export function morph(from, toHtml, options) { from.appendChild(holdover) currentFrom = holdover + fromKey = getKey(currentFrom) } else { if(! shouldSkip(adding, currentTo)) { // Add element... @@ -256,6 +257,7 @@ export function morph(from, toHtml, options) { // No "from" key... currentFrom.replaceWith(fromKeys[toKey]) currentFrom = fromKeys[toKey] + fromKey = getKey(currentFrom) } } @@ -267,6 +269,7 @@ export function morph(from, toHtml, options) { fromKeyHoldovers[fromKey] = currentFrom currentFrom.replaceWith(fromKeyNode) currentFrom = fromKeyNode + fromKey = getKey(currentFrom) } else { // Swap elements with keys... fromKeyHoldovers[fromKey] = currentFrom; // This ";" needs to be here...