@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.cjs CHANGED
@@ -495,9 +495,13 @@ function ReactPopup(props) {
495
495
  )
496
496
  }
497
497
  ),
498
- document.body
498
+ resolvePopupContainer(anchorRef?.current)
499
499
  );
500
500
  }
501
+ function resolvePopupContainer(anchor) {
502
+ const fullscreenElement = document.fullscreenElement;
503
+ return fullscreenElement instanceof HTMLElement && (!anchor || fullscreenElement.contains(anchor)) ? fullscreenElement : document.body;
504
+ }
501
505
  function resolvePopupPosition(params) {
502
506
  const {
503
507
  anchor,