@react-shimeji/core 0.2.2 → 0.2.3
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/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10,8 +10,9 @@ var DomManager = class {
|
|
|
10
10
|
handles = /* @__PURE__ */ new Set();
|
|
11
11
|
/** Reattaches mascot elements if application code temporarily removed them. */
|
|
12
12
|
ensureMounted() {
|
|
13
|
+
const target = this.container.ownerDocument.body;
|
|
13
14
|
for (const handle of this.handles) {
|
|
14
|
-
if (handle.element.parentElement !==
|
|
15
|
+
if (handle.element.parentElement !== target) target.appendChild(handle.element);
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
18
|
/** Returns viewport bounds because fixed mascots use viewport coordinates. */
|
|
@@ -31,7 +32,7 @@ var DomManager = class {
|
|
|
31
32
|
element.appendChild(spriteElement);
|
|
32
33
|
const handle = { element, spriteElement, spriteLease };
|
|
33
34
|
this.handles.add(handle);
|
|
34
|
-
this.container.appendChild(element);
|
|
35
|
+
this.container.ownerDocument.body.appendChild(element);
|
|
35
36
|
return handle;
|
|
36
37
|
}
|
|
37
38
|
/** Paints one mascot state into its existing DOM nodes. */
|