docs: fixed sidebar issue
PR for Issue #82
Fixes:
- Sidebar is now full height and is displaying properly on all devices in Chrome DevTools
- Body overflow is turned off when sidebar is displayed to prevent double scrollbar issues
Why not simply remove the overflow from the body and keep scrolling only inside scroll containers?
In order to preserve the functionality of <ScrollRestoration /> on mobile, I needed to keep body overflow visible. Otherwise, we would lost the "scroll back to top" functionality on navigation between pages
Why do we set document.body.style.overflow = 'visible' inside Docs.tsx?
Since the toggleBodyOverflow function works only when sidebar is toggled on/off and does not return the body overflow value to visible if navigated to the main page (clicking on the logo), we have to set it explicitly to visible in the component itself.
☝️ if you are aware of a better approach, please let me know, I would be happy to implement it :)
@skirianov is attempting to deploy a commit to the Tanstack Team on Vercel.
A member of the Team first needs to authorize it.
@tannerlinsley can you take a look please?