analytica-frontend-lib 1.1.87 → 1.1.88
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/DropdownMenu/index.js +24 -4
- package/dist/DropdownMenu/index.js.map +1 -1
- package/dist/DropdownMenu/index.mjs +24 -4
- package/dist/DropdownMenu/index.mjs.map +1 -1
- package/dist/Modal/index.js +24 -4
- package/dist/Modal/index.js.map +1 -1
- package/dist/Modal/index.mjs +24 -4
- package/dist/Modal/index.mjs.map +1 -1
- package/dist/NotificationCard/index.js +24 -4
- package/dist/NotificationCard/index.js.map +1 -1
- package/dist/NotificationCard/index.mjs +24 -4
- package/dist/NotificationCard/index.mjs.map +1 -1
- package/dist/Quiz/index.js +24 -4
- package/dist/Quiz/index.js.map +1 -1
- package/dist/Quiz/index.mjs +24 -4
- package/dist/Quiz/index.mjs.map +1 -1
- package/dist/Search/index.js +24 -4
- package/dist/Search/index.js.map +1 -1
- package/dist/Search/index.mjs +24 -4
- package/dist/Search/index.mjs.map +1 -1
- package/dist/index.js +24 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1924,14 +1924,34 @@ var Modal = ({
|
|
|
1924
1924
|
return () => document.removeEventListener("keydown", handleEscape);
|
|
1925
1925
|
}, [isOpen, closeOnEscape, onClose]);
|
|
1926
1926
|
useEffect3(() => {
|
|
1927
|
+
if (!isOpen) return;
|
|
1928
|
+
const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
|
|
1927
1929
|
const originalOverflow = document.body.style.overflow;
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
document.body.style.
|
|
1930
|
+
const originalPaddingRight = document.body.style.paddingRight;
|
|
1931
|
+
document.body.style.overflow = "hidden";
|
|
1932
|
+
if (scrollbarWidth > 0) {
|
|
1933
|
+
document.body.style.paddingRight = `${scrollbarWidth}px`;
|
|
1934
|
+
const overlay = document.createElement("div");
|
|
1935
|
+
overlay.id = "modal-scrollbar-overlay";
|
|
1936
|
+
overlay.style.cssText = `
|
|
1937
|
+
position: fixed;
|
|
1938
|
+
top: 0;
|
|
1939
|
+
right: 0;
|
|
1940
|
+
width: ${scrollbarWidth}px;
|
|
1941
|
+
height: 100vh;
|
|
1942
|
+
background-color: rgb(0 0 0 / 0.6);
|
|
1943
|
+
z-index: 40;
|
|
1944
|
+
pointer-events: none;
|
|
1945
|
+
`;
|
|
1946
|
+
document.body.appendChild(overlay);
|
|
1932
1947
|
}
|
|
1933
1948
|
return () => {
|
|
1934
1949
|
document.body.style.overflow = originalOverflow;
|
|
1950
|
+
document.body.style.paddingRight = originalPaddingRight;
|
|
1951
|
+
const overlay = document.getElementById("modal-scrollbar-overlay");
|
|
1952
|
+
if (overlay) {
|
|
1953
|
+
overlay.remove();
|
|
1954
|
+
}
|
|
1935
1955
|
};
|
|
1936
1956
|
}, [isOpen]);
|
|
1937
1957
|
if (!isOpen) return null;
|