From a1ea8691b503be1d2167aebb57053e28c8380938 Mon Sep 17 00:00:00 2001 From: Segun Adebayo Date: Mon, 25 Apr 2022 21:16:25 +0400 Subject: [PATCH] chore: update mutation utils --- packages/utilities/dom/src/mutation-observer.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/utilities/dom/src/mutation-observer.ts b/packages/utilities/dom/src/mutation-observer.ts index 305608aef2..6aa86a235f 100644 --- a/packages/utilities/dom/src/mutation-observer.ts +++ b/packages/utilities/dom/src/mutation-observer.ts @@ -19,7 +19,7 @@ export function observeAttributes(node: Element | null, attributes: string | str return () => obs.disconnect() } -export function observeChildren(node: Element | null, fn: Callback, subtree = false) { +export function observeChildren(node: Element | null, fn: Callback) { if (!node) return noop const win = node.ownerDocument.defaultView || window const obs = new win.MutationObserver((changes) => { @@ -30,7 +30,7 @@ export function observeChildren(node: Element | null, fn: Callback, subtree = fa } }) - obs.observe(node, { childList: true, subtree }) + obs.observe(node, { childList: true, subtree: true }) return () => obs.disconnect() }