fix: prevent duplicate page scrollbars

This commit is contained in:
2026-10-13 14:45:54 +03:00
parent 42f8019e27
commit b24a4b5856
4 changed files with 25 additions and 4 deletions

View File

@@ -1,6 +1,15 @@
@import "tailwindcss"; @import "tailwindcss";
@plugin "@tailwindcss/typography"; @plugin "@tailwindcss/typography";
html,
body,
#root {
margin: 0;
height: 100%;
min-height: 100%;
overflow: hidden;
}
button { button {
cursor: pointer; cursor: pointer;
} }

View File

@@ -76,9 +76,10 @@ export const RouteMap = observer(() => {
const parentRef = useRef<HTMLDivElement>(null); const parentRef = useRef<HTMLDivElement>(null);
useEffect(() => { useEffect(() => {
const previousBodyOverflow = document.body.style.overflow;
document.body.style.overflow = "hidden"; document.body.style.overflow = "hidden";
return () => { return () => {
document.body.style.overflow = "auto"; document.body.style.overflow = previousBodyOverflow;
}; };
}, []); }, []);

View File

@@ -42,7 +42,14 @@ export const Layout: React.FC<LayoutProps> = observer(({ children }) => {
}; };
return ( return (
<Box sx={{ display: "flex" }}> <Box
sx={{
display: "flex",
height: "100vh",
minHeight: 0,
overflow: "hidden",
}}
>
<AppBar position="fixed" open={open}> <AppBar position="fixed" open={open}>
<Toolbar className="flex justify-between"> <Toolbar className="flex justify-between">
<div className="flex items-center"> <div className="flex items-center">
@@ -149,9 +156,14 @@ export const Layout: React.FC<LayoutProps> = observer(({ children }) => {
sx={{ sx={{
width: "100%", width: "100%",
flexGrow: 1, flexGrow: 1,
minWidth: 0,
minHeight: 0,
height: "100vh",
p: 3, p: 3,
overflow: "auto", overflowY: "auto",
overflowX: "hidden",
maxWidth: "100vw", maxWidth: "100vw",
boxSizing: "border-box",
}} }}
> >
<div className="mt-16"></div> <div className="mt-16"></div>

View File

@@ -268,4 +268,3 @@
.sfp-sight-frame-media-stack.three-d-view { .sfp-sight-frame-media-stack.three-d-view {
background-color: #111 !important; background-color: #111 !important;
} }