Skip to content

Commit

Permalink
Fix teleport morphing
Browse files Browse the repository at this point in the history
  • Loading branch information
calebporzio committed Oct 31, 2023
1 parent d352364 commit 51af642
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/morph/src/morph.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ export function morph(from, toHtml, options) {
}

function patchChildren(from, to) {
// If we hit a <template x-teleport="body">,
// let's use the teleported nodes for this patch...
if (from._x_teleport) from = from._x_teleport
if (to._x_teleport) to = to._x_teleport

let fromKeys = keyToMap(from.children)
let fromKeyHoldovers = {}

Expand Down Expand Up @@ -444,10 +449,6 @@ function getFirstNode(parent) {
}

function getNextSibling(parent, reference) {
if (reference._x_teleport) {
return reference._x_teleport
}

let next

if (parent instanceof Block) {
Expand Down

0 comments on commit 51af642

Please sign in to comment.