@bindu-dashing/dam-solution-v2 5.8.181 → 5.8.182
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.
|
@@ -109,6 +109,19 @@ const FileDetails = ({ open, handleClose, file, files, fileIds, onCloseSelection
|
|
|
109
109
|
setState((prevState) => (Object.assign(Object.assign({}, prevState), { visible: false })));
|
|
110
110
|
}
|
|
111
111
|
}, [open]);
|
|
112
|
+
// Lock body scroll when preview modal is open so drive page files don't scroll behind it
|
|
113
|
+
useEffect(() => {
|
|
114
|
+
if (open && visible) {
|
|
115
|
+
const prevBodyOverflow = document.body.style.overflow;
|
|
116
|
+
const prevHtmlOverflow = document.documentElement.style.overflow;
|
|
117
|
+
document.body.style.overflow = "hidden";
|
|
118
|
+
document.documentElement.style.overflow = "hidden";
|
|
119
|
+
return () => {
|
|
120
|
+
document.body.style.overflow = prevBodyOverflow;
|
|
121
|
+
document.documentElement.style.overflow = prevHtmlOverflow;
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
}, [open, visible]);
|
|
112
125
|
if (!open && !visible)
|
|
113
126
|
return null;
|
|
114
127
|
const modalStyle = headerHeight > 0
|