From 57f15ddc025444a125607d3ea22ac01bc276112c Mon Sep 17 00:00:00 2001 From: Yanzhen Yu Date: Wed, 1 Apr 2026 12:00:00 +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 9d90daf9..3689c1b8 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);