rapi-doc / RapiDoc

RapiDoc -WebComponent for OpenAPI Spec
https://rapidocweb.com
MIT License
1.71k stars 285 forks source link

[Q] Disable sticky navigation in render-style "read" #916

Closed wolfgang-demeter closed 1 year ago

wolfgang-demeter commented 1 year ago

Is there an easy way or configuration to disable the sticky navigation when RapiDoc ist embedded in another HTML page and the parent element of RapiDoc has a height="auto" to avoid the scrollbars from RapiDoc-element/container and use the scrollbars of the page itself?

To reproduce:

https://user-images.githubusercontent.com/4437946/230116572-496c7864-3ba5-43cf-98a6-5e523caf4d8d.mp4

Btw. it's not an issue on mobile screens or when the navigation is not shown, e.g.:

rapi-doc::part(section-navbar) {
    display: none;
    // height: auto;
}
mrin9 commented 1 year ago

you must provide a height attribute to the rapidoc either using parent or directly to rapidoc for it to work in read mode. as we automatically highlight the navbar based on the scroll, and in that case it must know the height. using height:auto defeats the purpose or use render-style=focused