Skip to content

Commit d6b936f

Browse files
committed
Add skip children to morph
1 parent 3bb1bad commit d6b936f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/morph/src/morph.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ export function morph(from, toHtml, options) {
3434
}
3535

3636
let updateChildrenOnly = false
37+
let skipChildren = false
3738

38-
if (shouldSkip(updating, from, to, () => updateChildrenOnly = true)) return
39+
if (shouldSkip(updating, from, to, () => updateChildrenOnly = true, () => skipChildren = true)) return
3940

4041
// Initialize the server-side HTML element with Alpine...
4142
if (from.nodeType === 1 && window.Alpine) {
@@ -60,7 +61,9 @@ export function morph(from, toHtml, options) {
6061

6162
updated(from, to)
6263

63-
patchChildren(from, to)
64+
if (! skipChildren) {
65+
patchChildren(from, to)
66+
}
6467
}
6568

6669
function differentElementNamesTypesOrKeys(from, to) {

0 commit comments

Comments
 (0)