mount-observer 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/MountObserver.js CHANGED
@@ -281,7 +281,7 @@ export class MountObserver extends EventTarget {
281
281
  }
282
282
  }
283
283
  // Process children
284
- if (node.nodeType === Node.ELEMENT_NODE || node.nodeType === Node.DOCUMENT_NODE) {
284
+ if ('querySelectorAll' in node) {
285
285
  const root = node;
286
286
  // Get all elements matching the CSS selector first
287
287
  root.querySelectorAll(this.#init.whereElementMatches).forEach(child => {
package/MountObserver.ts CHANGED
@@ -370,8 +370,8 @@ export class MountObserver extends EventTarget implements IMountObserver {
370
370
  }
371
371
 
372
372
  // Process children
373
- if (node.nodeType === Node.ELEMENT_NODE || node.nodeType === Node.DOCUMENT_NODE) {
374
- const root = node as Element | Document;
373
+ if ('querySelectorAll' in node) {
374
+ const root = node as DocumentFragment;
375
375
 
376
376
  // Get all elements matching the CSS selector first
377
377
  root.querySelectorAll(this.#init.whereElementMatches).forEach(child => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mount-observer",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Observe and act on css matches.",
5
5
  "main": "MountObserver.js",
6
6
  "module": "MountObserver.js",