@landtrustinc/design-system 1.2.51-beta.0 → 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 CHANGED
@@ -6390,9 +6390,18 @@ var WidgetRoot = ({
6390
6390
  (0, import_react31.useEffect)(() => {
6391
6391
  if (!isExpanded)
6392
6392
  return;
6393
+ const mql = window.matchMedia(`(max-width: calc(${screens.lg} - 1px))`);
6393
6394
  const originalOverflow = document.body.style.overflow;
6394
- document.body.style.overflow = "hidden";
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);
6395
6403
  return () => {
6404
+ mql.removeEventListener("change", handleChange);
6396
6405
  document.body.style.overflow = originalOverflow;
6397
6406
  };
6398
6407
  }, [isExpanded]);