@vpmedia/phaser 1.122.0 → 1.123.0

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.js CHANGED
@@ -1720,8 +1720,8 @@ const setUserSelect = (canvas, value = "none") => {
1720
1720
  */
1721
1721
  const addToDOM = (canvas, parent, overflowHidden = true) => {
1722
1722
  let target = null;
1723
- if (typeof parent === "string") target = document.querySelector(`#${CSS.escape(parent)}`);
1724
- else if (parent?.nodeType === 1) target = parent;
1723
+ if (typeof parent === "string" && parent !== "") target = document.querySelector(`#${CSS.escape(parent)}`);
1724
+ else if (typeof parent === "object" && parent?.nodeType === 1) target = parent;
1725
1725
  target ??= document.body;
1726
1726
  if (overflowHidden) target.style.overflow = "hidden";
1727
1727
  target.append(canvas);