Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
黄南光
/
wiki_knowledge
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e96f7fe7
authored
Jul 21, 2026
by
黄南光
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复前端预览滑轮滚动问题
1 parent
cc153b69
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletions
frontend/package.json
frontend/src/app/page.tsx
frontend/package.json
View file @
e96f7fe
...
...
@@ -6,6 +6,7 @@
"dev"
:
"next dev -H 0.0.0.0 --webpack"
,
"build"
:
"next build"
,
"start"
:
"next start -H 0.0.0.0"
,
"test:scroll-lock"
:
"node scripts/check-preview-modal-scroll-lock.mjs"
,
"lint"
:
"eslint"
},
"dependencies"
:
{
...
...
frontend/src/app/page.tsx
View file @
e96f7fe
...
...
@@ -399,6 +399,21 @@ export default function EnterpriseWiki() {
useEffect(() => {
lintEndRef.current?.scrollIntoView({ behavior: "smooth" });
}, [lintHistory]);
useEffect(() => {
if (!isModalOpen) return undefined;
const previousBodyOverflow = document.body.style.overflow;
const previousBodyOverscrollBehavior = document.body.style.overscrollBehavior;
document.body.style.overflow = "hidden";
document.body.style.overscrollBehavior = "contain";
return () => {
document.body.style.overflow = previousBodyOverflow;
document.body.style.overscrollBehavior = previousBodyOverscrollBehavior;
};
}, [isModalOpen]);
const [searchQuery, setSearchQuery] = useState("");
const [searchInput, setSearchInput] = useState("");
const [sortBy, setSortBy] = useState<"name" | "time" | "size" | "status" | "format" | "id">("time");
...
...
@@ -1613,6 +1628,7 @@ export default function EnterpriseWiki() {
"group hover:bg-slate-50/80 transition-colors cursor-pointer",
selectedFileId === file.id && "bg-blue-50/30"
)}
// eslint-disable-next-line react-hooks/refs -- ref access happens after the row click starts preview loading.
onClick={() => onSelectFile(file.id)}
>
<td className="px-6 py-4 whitespace-nowrap" onClick={(e) => e.stopPropagation()}>
...
...
@@ -1829,7 +1845,10 @@ export default function EnterpriseWiki() {
{/* 3. Preview Modal */}
{isModalOpen && (
<div className="fixed inset-0 z-[60] flex items-center justify-center p-6 bg-slate-900/60 backdrop-blur-sm animate-in fade-in duration-300">
<div
className="fixed inset-0 z-[60] flex items-center justify-center p-6 bg-slate-900/60 backdrop-blur-sm animate-in fade-in duration-300 overflow-hidden overscroll-contain"
onWheel={(e) => e.stopPropagation()}
>
<div className="bg-white w-full max-w-[75vw] h-[94vh] rounded-[2rem] shadow-2xl flex flex-col overflow-hidden animate-in zoom-in-95 duration-300">
<header className="px-8 py-6 border-b border-slate-100 flex items-center justify-between shrink-0">
<div className="flex items-center gap-4">
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment