From 9ce8ab40d4386757b150f5faf602ceab336658e3 Mon Sep 17 00:00:00 2001 From: Yanzhen Yu Date: Sat, 16 Jan 2021 22:31:57 +0800 Subject: [PATCH] fix #460 ignore added node that are not in document anymore --- src/record/mutation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/record/mutation.ts b/src/record/mutation.ts index 9d90daf9f6..3689c1b847 100644 --- a/src/record/mutation.ts +++ b/src/record/mutation.ts @@ -210,7 +210,7 @@ export default class MutationBuffer { return nextId; }; const pushAdd = (n: Node) => { - if (!n.parentNode) { + if (!n.parentNode || !document.contains(n)) { return; } const parentId = mirror.getId((n.parentNode as Node) as INode);