@canvas-components/react-components 0.3.9 → 0.3.10

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
@@ -474,9 +474,13 @@ function ReactPopup(props) {
474
474
  )
475
475
  }
476
476
  ),
477
- document.body
477
+ resolvePopupContainer(anchorRef?.current)
478
478
  );
479
479
  }
480
+ function resolvePopupContainer(anchor) {
481
+ const fullscreenElement = document.fullscreenElement;
482
+ return fullscreenElement instanceof HTMLElement && (!anchor || fullscreenElement.contains(anchor)) ? fullscreenElement : document.body;
483
+ }
480
484
  function resolvePopupPosition(params) {
481
485
  const {
482
486
  anchor,