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

Sidebar scroll not working properly with offset #365

Open
herrera-ignacio opened this issue Jun 5, 2024 · 0 comments
Open

Sidebar scroll not working properly with offset #365

herrera-ignacio opened this issue Jun 5, 2024 · 0 comments

Comments

@herrera-ignacio
Copy link

Note: This issue might be similar to #360 but slightly different. In this case, the navbar is not hidden behind the navbar.

Precondition

  • Sidebar has enough items to not fit on the screen (i.e., vertical overflow) and becomes scrollable.
  • There's a fixed navbar.

Issue:

  • The navbar creates an offset and makes the sidebar not quite fit on the screen. Therefore, you can't see some items at the end of the sidebar by scrolling (depending on nav height).
  • If you scroll the page, and the navbar hides, you'll be able to side those items.
Screen.Recording.2024-06-05.at.5.55.59.PM.mov

Attempts to solve

  • Swizzling docusaurus-theme-redoc. I was not able to get to the sidebar styling to apply some sort of vertical padding but I think that could be a hot fix. When ejecting the Redoc component (or its dependencies), a lot of relative imports that it uses get broken.
  • I tried applying either scrollYOffset: 50 or scrollYOffset: nav.navbar to fix the issue and it does but it creates another one, the sidebar won't occupy the navbar space when the navbar is hidden, and it looks odd (notice on the following image that the sidebar's right border doesn't reach the top) Another solution could be that the scrollYOffset only applies when the navbar is not present but I don't think the options support this.
image

Ideal scenarios

  • Being able to apply custom styles to the sidebar (e.g., padding-bottom)
  • Being able to swizzle Redoc's sidebar (either Wrap or Eject)
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

No branches or pull requests

1 participant