Skip to content

Commit 92ef7eb

Browse files
authored
fix(observedom): Callback not being called for changes other than node inert/remove
Allow callback to be called based on passed options. Previously it was only being called if nodes were added or inserted, regardless of which options were passed (i.e. attribute changes, childList, textnode changes, etc.) This fix remove this restriction.
1 parent 5790b39 commit 92ef7eb

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/utils/observe-dom.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ export default function observeDOM(el, callback, opts) {
1414
if (MutationObserver) {
1515
// Define a new observer
1616
const obs = new MutationObserver(mutations => {
17-
if (mutations[0].addedNodes.length > 0 || mutations[0].removedNodes.length > 0) {
18-
callback();
19-
}
17+
callback();
2018
});
2119

2220
// Have the observer observe foo for changes in children

0 commit comments

Comments
 (0)