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:
Filip Slatinac
2020-03-01 02:02:32 -05:00
committed by GitHub
parent 444570b7fc
commit fc6c6c43d5

View File

@@ -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);
}