kylekyle / monitoring

A simple, efficient, and lightweight ES module to monitor the DOM for when elements are added, removed, have appeared, have disappeared, or are resized.
17 stars 1 forks source link

Module does not monitor nested nodes #5

Open Kesantielu opened 2 years ago

Kesantielu commented 2 years ago

If the MutationRecord contains nested child elements and the target is one of them, it is not processed.

For example

monitor.added('.target', target => console.log(`target added`));

added node:

<div>
    <div class="target"></div>
</div>