Checking node existence (#174)
* added our package * reverted back to old rrweb snapshot * Array.from does not capture all elements added in the set, we have to manually iterate through the iterator * package lock * checking if nodes are in the parent before we try inserting them
This commit is contained in:
@@ -409,7 +409,11 @@ export class Replayer {
|
||||
) {
|
||||
parent.insertBefore(target, previous.nextSibling);
|
||||
} else if (next && next.parentNode) {
|
||||
parent.insertBefore(target, next);
|
||||
// making sure the parent contains the reference nodes
|
||||
// before we insert target before next.
|
||||
parent.contains(next)
|
||||
? parent.insertBefore(target, next)
|
||||
: parent.insertBefore(target, null);
|
||||
} else {
|
||||
parent.appendChild(target);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user