fix #460 ignore added node that are not in document anymore

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent bc6e6101d3
commit 57f15ddc02

View File

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