myoperator-mcp 0.2.156 → 0.2.158
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 +29 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2310,12 +2310,37 @@ const hasDialogDescription = (children: React.ReactNode): boolean => {
|
|
|
2310
2310
|
const DialogContent = React.forwardRef(({ className, children, size, hideCloseButton = false, ...props }: DialogContentProps, ref: React.Ref<React.ElementRef<typeof DialogPrimitive.Content>>) => {
|
|
2311
2311
|
const hasDescription = hasDialogDescription(children);
|
|
2312
2312
|
|
|
2313
|
-
// Lock
|
|
2313
|
+
// Lock ALL scroll when dialog is open \u2014 position:fixed on body prevents scroll
|
|
2314
|
+
// regardless of whether the host app scrolls on <body>, <html>, or a wrapper div.
|
|
2315
|
+
// Only activates when dialog is truly open (has role="dialog" in DOM), not in
|
|
2316
|
+
// Storybook static renders.
|
|
2314
2317
|
React.useEffect(() => {
|
|
2315
|
-
const
|
|
2316
|
-
|
|
2318
|
+
const dialogEl = document.querySelector("[role='dialog'][data-state='open']");
|
|
2319
|
+
if (!dialogEl) return;
|
|
2320
|
+
|
|
2321
|
+
const scrollY = window.scrollY;
|
|
2322
|
+
const body = document.body;
|
|
2323
|
+
const html = document.documentElement;
|
|
2324
|
+
|
|
2325
|
+
const originalBodyPosition = body.style.position;
|
|
2326
|
+
const originalBodyTop = body.style.top;
|
|
2327
|
+
const originalBodyWidth = body.style.width;
|
|
2328
|
+
const originalBodyOverflow = body.style.overflow;
|
|
2329
|
+
const originalHtmlOverflow = html.style.overflow;
|
|
2330
|
+
|
|
2331
|
+
body.style.position = "fixed";
|
|
2332
|
+
body.style.top = \`-\${scrollY}px\`;
|
|
2333
|
+
body.style.width = "100%";
|
|
2334
|
+
body.style.overflow = "hidden";
|
|
2335
|
+
html.style.overflow = "hidden";
|
|
2336
|
+
|
|
2317
2337
|
return () => {
|
|
2318
|
-
|
|
2338
|
+
body.style.position = originalBodyPosition;
|
|
2339
|
+
body.style.top = originalBodyTop;
|
|
2340
|
+
body.style.width = originalBodyWidth;
|
|
2341
|
+
body.style.overflow = originalBodyOverflow;
|
|
2342
|
+
html.style.overflow = originalHtmlOverflow;
|
|
2343
|
+
window.scrollTo(0, scrollY);
|
|
2319
2344
|
};
|
|
2320
2345
|
}, []);
|
|
2321
2346
|
|
package/package.json
CHANGED