Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fixed sidebar issue #83

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

skirianov
Copy link

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 :)

@vercel
Copy link

vercel bot commented May 3, 2023

@skirianov is attempting to deploy a commit to the Tanstack Team on Vercel.

A member of the Team first needs to authorize it.

@skirianov
Copy link
Author

@tannerlinsley can you take a look please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant