@landtrustinc/design-system 1.2.51-beta.1 → 1.2.51-beta.2
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 +10 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6390,12 +6390,18 @@ var WidgetRoot = ({
|
|
|
6390
6390
|
(0, import_react31.useEffect)(() => {
|
|
6391
6391
|
if (!isExpanded)
|
|
6392
6392
|
return;
|
|
6393
|
-
const
|
|
6394
|
-
if (!isMobile)
|
|
6395
|
-
return;
|
|
6393
|
+
const mql = window.matchMedia(`(max-width: calc(${screens.lg} - 1px))`);
|
|
6396
6394
|
const originalOverflow = document.body.style.overflow;
|
|
6397
|
-
|
|
6395
|
+
const applyScrollLock = (isMobile) => {
|
|
6396
|
+
document.body.style.overflow = isMobile ? "hidden" : originalOverflow;
|
|
6397
|
+
};
|
|
6398
|
+
const handleChange = (e) => {
|
|
6399
|
+
applyScrollLock(e.matches);
|
|
6400
|
+
};
|
|
6401
|
+
applyScrollLock(mql.matches);
|
|
6402
|
+
mql.addEventListener("change", handleChange);
|
|
6398
6403
|
return () => {
|
|
6404
|
+
mql.removeEventListener("change", handleChange);
|
|
6399
6405
|
document.body.style.overflow = originalOverflow;
|
|
6400
6406
|
};
|
|
6401
6407
|
}, [isExpanded]);
|