@yakad/ui 1.3.151 → 1.3.152

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.
@@ -29,7 +29,9 @@ export const WithOverlay = forwardRef(function WithOverlay(_a, forwardedRef) {
29
29
  };
30
30
  }, [showOverlay]);
31
31
  // Teleport Overlay to portalRoot or body
32
+ const portalRoot = document.getElementsByClassName("portalRoot")[0] || document.body;
32
33
  const teleport = overlay &&
34
+ portalRoot &&
33
35
  createPortal(cloneElement(overlay, {
34
36
  triggerref: triggerRef,
35
37
  onClose: () => {
@@ -37,8 +39,7 @@ export const WithOverlay = forwardRef(function WithOverlay(_a, forwardedRef) {
37
39
  (_b = (_a = overlay.props).onClose) === null || _b === void 0 ? void 0 : _b.call(_a);
38
40
  setShowOverlay(false);
39
41
  },
40
- }), document.getElementsByClassName("portalRoot")[0] ||
41
- document.body);
42
+ }), portalRoot);
42
43
  return (_jsxs(_Fragment, { children: [_jsx(WithInteractions, Object.assign({ ref: triggerRef }, restProps, { onRightClick: (e) => {
43
44
  trigger === "onRightClick" && setShowOverlay(true);
44
45
  onRightClick === null || onRightClick === void 0 ? void 0 : onRightClick(e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yakad/ui",
3
- "version": "1.3.151",
3
+ "version": "1.3.152",
4
4
  "private": false,
5
5
  "author": "Natiq",
6
6
  "description": "UI components for NextJS/React",