From b24a4b585672f1ee7ec491e0d3d7da6483e44408 Mon Sep 17 00:00:00 2001 From: itoshi Date: Tue, 13 Oct 2026 14:45:54 +0300 Subject: [PATCH] fix: prevent duplicate page scrollbars --- src/index.css | 9 +++++++++ src/pages/Route/route-preview/index.tsx | 3 ++- src/widgets/Layout/index.tsx | 16 ++++++++++++++-- .../RightWidgetTab/SightFramePreview.css | 1 - 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/index.css b/src/index.css index 895f18d..5cdf02c 100644 --- a/src/index.css +++ b/src/index.css @@ -1,6 +1,15 @@ @import "tailwindcss"; @plugin "@tailwindcss/typography"; +html, +body, +#root { + margin: 0; + height: 100%; + min-height: 100%; + overflow: hidden; +} + button { cursor: pointer; } diff --git a/src/pages/Route/route-preview/index.tsx b/src/pages/Route/route-preview/index.tsx index 0aaa7c1..1141092 100644 --- a/src/pages/Route/route-preview/index.tsx +++ b/src/pages/Route/route-preview/index.tsx @@ -76,9 +76,10 @@ export const RouteMap = observer(() => { const parentRef = useRef(null); useEffect(() => { + const previousBodyOverflow = document.body.style.overflow; document.body.style.overflow = "hidden"; return () => { - document.body.style.overflow = "auto"; + document.body.style.overflow = previousBodyOverflow; }; }, []); diff --git a/src/widgets/Layout/index.tsx b/src/widgets/Layout/index.tsx index 10e2723..81c1d5a 100644 --- a/src/widgets/Layout/index.tsx +++ b/src/widgets/Layout/index.tsx @@ -42,7 +42,14 @@ export const Layout: React.FC = observer(({ children }) => { }; return ( - +
@@ -149,9 +156,14 @@ export const Layout: React.FC = observer(({ children }) => { sx={{ width: "100%", flexGrow: 1, + minWidth: 0, + minHeight: 0, + height: "100vh", p: 3, - overflow: "auto", + overflowY: "auto", + overflowX: "hidden", maxWidth: "100vw", + boxSizing: "border-box", }} >
diff --git a/src/widgets/SightTabs/RightWidgetTab/SightFramePreview.css b/src/widgets/SightTabs/RightWidgetTab/SightFramePreview.css index c8308c2..b23c962 100644 --- a/src/widgets/SightTabs/RightWidgetTab/SightFramePreview.css +++ b/src/widgets/SightTabs/RightWidgetTab/SightFramePreview.css @@ -268,4 +268,3 @@ .sfp-sight-frame-media-stack.three-d-view { background-color: #111 !important; } -