analytica-frontend-lib 1.1.87 → 1.1.89
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 +26 -10
- package/dist/Quiz/index.js.map +1 -1
- package/dist/Quiz/index.mjs +26 -10
- 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 +26 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +26 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -217,14 +217,34 @@ var Modal = ({
|
|
|
217
217
|
return () => document.removeEventListener("keydown", handleEscape);
|
|
218
218
|
}, [isOpen, closeOnEscape, onClose]);
|
|
219
219
|
useEffect(() => {
|
|
220
|
+
if (!isOpen) return;
|
|
221
|
+
const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
|
|
220
222
|
const originalOverflow = document.body.style.overflow;
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
document.body.style.
|
|
223
|
+
const originalPaddingRight = document.body.style.paddingRight;
|
|
224
|
+
document.body.style.overflow = "hidden";
|
|
225
|
+
if (scrollbarWidth > 0) {
|
|
226
|
+
document.body.style.paddingRight = `${scrollbarWidth}px`;
|
|
227
|
+
const overlay = document.createElement("div");
|
|
228
|
+
overlay.id = "modal-scrollbar-overlay";
|
|
229
|
+
overlay.style.cssText = `
|
|
230
|
+
position: fixed;
|
|
231
|
+
top: 0;
|
|
232
|
+
right: 0;
|
|
233
|
+
width: ${scrollbarWidth}px;
|
|
234
|
+
height: 100vh;
|
|
235
|
+
background-color: rgb(0 0 0 / 0.6);
|
|
236
|
+
z-index: 40;
|
|
237
|
+
pointer-events: none;
|
|
238
|
+
`;
|
|
239
|
+
document.body.appendChild(overlay);
|
|
225
240
|
}
|
|
226
241
|
return () => {
|
|
227
242
|
document.body.style.overflow = originalOverflow;
|
|
243
|
+
document.body.style.paddingRight = originalPaddingRight;
|
|
244
|
+
const overlay = document.getElementById("modal-scrollbar-overlay");
|
|
245
|
+
if (overlay) {
|
|
246
|
+
overlay.remove();
|
|
247
|
+
}
|
|
228
248
|
};
|
|
229
249
|
}, [isOpen]);
|
|
230
250
|
if (!isOpen) return null;
|