fix(流转树): 弹窗打开时锁定背景滚动,消除滚动穿透

- 通用 Modal 打开时 body overflow=hidden,关闭时恢复
- 修复流转树宽屏弹窗滚动时背景看板跟随滚动的问题
- TaskFlowView 记录弹窗同步加锁(覆盖无外层弹窗的页面内打开场景)
This commit is contained in:
2026-08-28 11:24:59 +08:00
parent ddb1b4364b
commit 1bb93e0a5f
2 changed files with 18 additions and 2 deletions

View File

@ -1,4 +1,4 @@
import { useState, useCallback, useMemo, memo } from "react";
import { useState, useCallback, useMemo, useEffect, memo } from "react";
import {
Search,
Loader2,
@ -40,6 +40,14 @@ export const Modal = memo(function Modal({
widthClass?: string;
bodyClassName?: string;
}) {
// 🚀 弹窗打开时锁定背景滚动(防止滚动穿透),关闭时恢复
useEffect(() => {
if (!open) return;
const prev = document.body.style.overflow;
document.body.style.overflow = "hidden";
return () => { document.body.style.overflow = prev; };
}, [open]);
if (!open) return null;
return (