tangled
alpha
login
or
join now
yippee.fun
/
morphlex
0
fork
atom
Precise DOM morphing
morphing
typescript
dom
0
fork
atom
overview
issues
pulls
pipelines
fix bug
joel.drapper.me
4 months ago
c987a276
88e0df53
+8
-2
1 changed file
expand all
collapse all
unified
split
src
morphlex.ts
+8
-2
src/morphlex.ts
···
406
406
this.morphOneToOne(match, node)
407
407
insertionPoint = match.nextSibling
408
408
// Skip over any nodes that will be removed to avoid unnecessary moves
409
409
-
while (insertionPoint && candidateNodes.has(insertionPoint)) {
409
409
+
while (
410
410
+
insertionPoint &&
411
411
+
(candidateNodes.has(insertionPoint) || (isElement(insertionPoint) && candidateElements.has(insertionPoint)))
412
412
+
) {
410
413
insertionPoint = insertionPoint.nextSibling
411
414
}
412
415
} else {
···
415
418
this.options.afterNodeAdded?.(node)
416
419
insertionPoint = node.nextSibling
417
420
// Skip over any nodes that will be removed to avoid unnecessary moves
418
418
-
while (insertionPoint && candidateNodes.has(insertionPoint)) {
421
421
+
while (
422
422
+
insertionPoint &&
423
423
+
(candidateNodes.has(insertionPoint) || (isElement(insertionPoint) && candidateElements.has(insertionPoint)))
424
424
+
) {
419
425
insertionPoint = insertionPoint.nextSibling
420
426
}
421
427
}