mirror of
https://github.com/codex-team/editor.js
synced 2024-06-09 09:22:16 +02:00
add comment explaining isMutationBelongsToElement behaviour in case of adding/removing the passed element itself
This commit is contained in:
parent
df7fdcbf56
commit
7cd05fe6eb
|
@ -11,6 +11,9 @@ export function isMutationBelongsToElement(mutationRecord: MutationRecord, eleme
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* In case of removing/adding the element itself, mutation type will be 'childList' and 'removedNodes'/'addedNodes' will contain the element.
|
||||
*/
|
||||
if (type === 'childList') {
|
||||
const elementAddedItself = Array.from(addedNodes).some(node => node === element);
|
||||
if (elementAddedItself) {
|
||||
|
|
Loading…
Reference in a new issue