@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.js
CHANGED
|
@@ -5601,7 +5601,7 @@ function ReactModal(props) {
|
|
|
5601
5601
|
if (!transition.rendered || typeof document === "undefined") {
|
|
5602
5602
|
return null;
|
|
5603
5603
|
}
|
|
5604
|
-
const container = resolveContainer(getContainer);
|
|
5604
|
+
const container = resolveContainer(getContainer, panelRef.current);
|
|
5605
5605
|
if (!container) {
|
|
5606
5606
|
return null;
|
|
5607
5607
|
}
|
|
@@ -5695,6 +5695,7 @@ function ReactModal(props) {
|
|
|
5695
5695
|
width: !mergedFullscreen ? resizeSize?.width ?? width : width,
|
|
5696
5696
|
...!mergedFullscreen && resizeSize ? { height: resizeSize.height } : void 0,
|
|
5697
5697
|
...style,
|
|
5698
|
+
...mergedFullscreen ? { width: "100%", height: "100%" } : void 0,
|
|
5698
5699
|
...(draggable || resizable) && !mergedFullscreen ? {
|
|
5699
5700
|
position: "relative",
|
|
5700
5701
|
left: dragOffset.x,
|
|
@@ -5814,13 +5815,18 @@ function ReactModal(props) {
|
|
|
5814
5815
|
container
|
|
5815
5816
|
);
|
|
5816
5817
|
}
|
|
5817
|
-
function resolveContainer(getContainer) {
|
|
5818
|
+
function resolveContainer(getContainer, panel) {
|
|
5818
5819
|
if (typeof document === "undefined") {
|
|
5819
5820
|
return null;
|
|
5820
5821
|
}
|
|
5821
5822
|
if (typeof getContainer === "function") return getContainer();
|
|
5822
5823
|
if (getContainer) return getContainer;
|
|
5823
|
-
|
|
5824
|
+
const fullscreenNode = document.fullscreenElement;
|
|
5825
|
+
if (!(fullscreenNode instanceof HTMLElement)) return document.body;
|
|
5826
|
+
if (panel?.contains(fullscreenNode)) {
|
|
5827
|
+
return panel.closest(`.${REACT_COMPONENT_PREFIX}-modal-root`)?.parentElement ?? document.body;
|
|
5828
|
+
}
|
|
5829
|
+
return fullscreenNode;
|
|
5824
5830
|
}
|
|
5825
5831
|
function trapFocus(event, panel) {
|
|
5826
5832
|
if (!panel) {
|