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

Scroll Y Offset when scrolling to element #990

Open
ImperviousPanda opened this issue Dec 30, 2023 · 0 comments
Open

Scroll Y Offset when scrolling to element #990

ImperviousPanda opened this issue Dec 30, 2023 · 0 comments

Comments

@ImperviousPanda
Copy link

Hello, I am just starting to use rapidoc with our APIs and I am trying to add it as a page inside of our website.

Unfortunately this website has a floating scrollbar. So when a user clicks on an endpoint and rapidoc scrolls to the top of that element, the floating header is covering the element. I think what I need is a feature similar to the redoc's 'scroll-y-offset'. So when it does scroll to an element it adds an amount to that scroll position.

Does this feature exist in Rapidoc? Or is there another/better way to do this?

I saw in other git issues the suggestion is to add padding to the parent div of the redoc web element. I am doing this so that the documentation isn't covered by the header, but it still scrolls to the same place. Maybe I am doing this wrong?

Using it in React:

          <div style={{paddingTop: "150px", background: "black" }}>
            <rapi-doc
              spec-url="https://myradar-public-open-api.s3.amazonaws.com/openapi-joined.yaml"
              theme = "dark"
              primary-color = "#8d56ff"
              show-header = "false"
              font-size = "large"
              api-key-name = "Subscription-Key"
              api-key-value = "feef5fc1acfd45c8b59359c15a6622a2"
              api-key-location = "header"
              update-route = "false"
            ></rapi-doc>
          </div>
          ```

Thank you for your time!
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