mirror of
https://github.com/codex-team/editor.js
synced 2024-06-09 09:22:16 +02:00
isMutationBelongsToElement function shouldn't return true if some of the ancestors of the passed element were added or deleted, only if the element itself
This commit is contained in:
parent
040760c6b3
commit
439adcd410
|
@ -12,11 +12,11 @@ export function isMutationBelongsToElement(mutationRecord: MutationRecord, eleme
|
|||
}
|
||||
|
||||
if (type === 'childList') {
|
||||
const elementAddedItself = Array.from(addedNodes).some(node => node.contains(element));
|
||||
const elementAddedItself = Array.from(addedNodes).some(node => node === element);
|
||||
if (elementAddedItself) {
|
||||
return true;
|
||||
}
|
||||
const elementRemovedItself = Array.from(removedNodes).some(node => node.contains(element));
|
||||
const elementRemovedItself = Array.from(removedNodes).some(node => node === element);
|
||||
if (elementRemovedItself) {
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue