mount-observer 0.0.86 → 0.0.87

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mount-observer",
3
- "version": "0.0.86",
3
+ "version": "0.0.87",
4
4
  "description": "Observe and act on css matches.",
5
5
  "main": "MountObserver.js",
6
6
  "module": "MountObserver.js",
package/upShadowSearch.js CHANGED
@@ -14,9 +14,12 @@ export function upShadowSearch(ref, id) {
14
14
  return null;
15
15
  }
16
16
  else if (!rn.isConnected) {
17
- //TODO: search first for targetFragment
18
- rn = document;
17
+ if (rn.targetFragment) {
18
+ rn = rn.targetFragment;
19
+ }
20
+ else {
21
+ rn = document;
22
+ }
19
23
  }
20
- //return null;
21
24
  }
22
25
  }
package/upShadowSearch.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export function upShadowSearch(ref: Element, id: string){
2
- let rn = ref.getRootNode() as (Document | DocumentFragment | ShadowRoot) & { host?: Element };
2
+ let rn = ref.getRootNode() as any;
3
3
  while(rn){
4
4
  let test = rn.getElementById(id);
5
5
  if(test) return test;
@@ -10,11 +10,14 @@ export function upShadowSearch(ref: Element, id: string){
10
10
  }else if(rn === document){
11
11
  return null;
12
12
  }else if(!rn.isConnected){
13
- //TODO: search first for targetFragment
14
- rn = document;
13
+ if(rn.targetFragment){
14
+ rn = rn.targetFragment;
15
+ }else{
16
+ rn = document;
17
+ }
18
+
15
19
 
16
20
  }
17
- //return null;
18
21
  }
19
22
  }
20
23