@canvas-components/react-components 0.3.12 → 0.3.13
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 +9 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -5622,7 +5622,7 @@ function ReactModal(props) {
|
|
|
5622
5622
|
if (!transition.rendered || typeof document === "undefined") {
|
|
5623
5623
|
return null;
|
|
5624
5624
|
}
|
|
5625
|
-
const container = resolveContainer(getContainer);
|
|
5625
|
+
const container = resolveContainer(getContainer, panelRef.current);
|
|
5626
5626
|
if (!container) {
|
|
5627
5627
|
return null;
|
|
5628
5628
|
}
|
|
@@ -5716,6 +5716,7 @@ function ReactModal(props) {
|
|
|
5716
5716
|
width: !mergedFullscreen ? resizeSize?.width ?? width : width,
|
|
5717
5717
|
...!mergedFullscreen && resizeSize ? { height: resizeSize.height } : void 0,
|
|
5718
5718
|
...style,
|
|
5719
|
+
...mergedFullscreen ? { width: "100%", height: "100%" } : void 0,
|
|
5719
5720
|
...(draggable || resizable) && !mergedFullscreen ? {
|
|
5720
5721
|
position: "relative",
|
|
5721
5722
|
left: dragOffset.x,
|
|
@@ -5835,13 +5836,18 @@ function ReactModal(props) {
|
|
|
5835
5836
|
container
|
|
5836
5837
|
);
|
|
5837
5838
|
}
|
|
5838
|
-
function resolveContainer(getContainer) {
|
|
5839
|
+
function resolveContainer(getContainer, panel) {
|
|
5839
5840
|
if (typeof document === "undefined") {
|
|
5840
5841
|
return null;
|
|
5841
5842
|
}
|
|
5842
5843
|
if (typeof getContainer === "function") return getContainer();
|
|
5843
5844
|
if (getContainer) return getContainer;
|
|
5844
|
-
|
|
5845
|
+
const fullscreenNode = document.fullscreenElement;
|
|
5846
|
+
if (!(fullscreenNode instanceof HTMLElement)) return document.body;
|
|
5847
|
+
if (panel?.contains(fullscreenNode)) {
|
|
5848
|
+
return panel.closest(`.${REACT_COMPONENT_PREFIX}-modal-root`)?.parentElement ?? document.body;
|
|
5849
|
+
}
|
|
5850
|
+
return fullscreenNode;
|
|
5845
5851
|
}
|
|
5846
5852
|
function trapFocus(event, panel) {
|
|
5847
5853
|
if (!panel) {
|