diff --git a/app/components/Docs.tsx b/app/components/Docs.tsx index d6a2819e..72870bf8 100644 --- a/app/components/Docs.tsx +++ b/app/components/Docs.tsx @@ -50,7 +50,6 @@ export function Docs({ v2?: boolean }) { const matches = useMatches() - console.log(matches) const lastMatch = last(matches) const detailsRef = React.useRef(null!) @@ -70,6 +69,15 @@ export function Docs({ const index = flatMenu.findIndex((d) => d.to === relativePathname) const prevItem = flatMenu[index - 1] const nextItem = flatMenu[index + 1] + + document.body.style.overflow = 'visible' + const toggleBodyOverflow = () => { + if (detailsRef.current?.hasAttribute('open')) { + document.body.style.overflow = 'hidden' + } else { + document.body.style.overflow = 'visible' + } + } const menuItems = config.menu.map((group, i) => { return ( @@ -147,6 +155,7 @@ export function Docs({ ref={detailsRef as any} id="docs-details" className="border-b border-gray-500 border-opacity-20" + onToggle={toggleBodyOverflow} >
@@ -157,9 +166,9 @@ export function Docs({
{framework?.selected ? ( diff --git a/app/styles/app.css b/app/styles/app.css index 311632f6..0130c0b6 100644 --- a/app/styles/app.css +++ b/app/styles/app.css @@ -83,10 +83,6 @@ display: none; } - #docs-details[open] > summary + * { - height: 80vh; - } - .anchor-heading { text-decoration: none !important; }