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 scrolls under navbar on direct visit #360

Open
notAreYouScared opened this issue Apr 29, 2024 · 1 comment
Open

Sidebar scrolls under navbar on direct visit #360

notAreYouScared opened this issue Apr 29, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@notAreYouScared
Copy link

notAreYouScared commented Apr 29, 2024

image

This happens with both search-bar enabled and disabled.

The issue appears only when you navigate directly to the API page

Recreatable on every website under Who is using Redocusaurus?

Steps to reproduce.

  1. Navigate to https://redocusaurus.vercel.app/docs
  2. Navigate from /doc to /examples/using-single-yaml/ using navbar, No issue works as expected when navigating to API from a navbar item
  3. Reload /examples/using-single-yaml/, scroll, observe issue on sidebar.
@notAreYouScared notAreYouScared changed the title Sidebar scrolls under navbar Sidebar scrolls under navbar on direct visit Apr 30, 2024
@tkenda
Copy link

tkenda commented May 13, 2024

Create a file redocly.yaml with this configuration:

extends:
  - recommended

rules:
  no-unused-components: error

theme:
  openapi:
    requiredPropsFirst: true
    noAutoAuth: true
    hideDownloadButton: true
    onlyRequiredInSamples: true
    nativeScrollbars: true
    scrollYOffset: 60
    theme:
      colors:
        primary:
          main: '#32329f'

and then setup presets in docusarus.config.ts

presets: [
  [
    "classic",
    {
      docs: {
        sidebarPath: "./sidebars.ts",
      },
      theme: {
        customCss: "./src/css/custom.css",
      },
    } satisfies Preset.Options,
  ],
  [
    "redocusaurus",
    {
      config: path.join(__dirname, 'redocly.yaml'),
      specs: [
        {
          spec: "./specs/swagger.json",
          route: "/api/",
        },
      ],
      theme: {
        primaryColor: "#1890ff",
      },
    },
  ] satisfies Redocusaurus.PresetEntry,
]

This will solve your issue!

@rohit-gohri rohit-gohri added the bug Something isn't working label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants