How to integrate swagger-editor to a React SPA?

163 views Asked by At

My plan is to add swagger-editor to a React app, in a page that already has a navbar and other stuff.

But whenever I try to add height or any CSS to the editor, to keep it within it's container, the scroll gets weird.

The editor itself is in the correct place, but I can never scroll to the bottom of the YAML, and the scrollbar goes out of view when scrolling down.

Like in this screenshot, it looks fine, but that YAML is very long and I can never scroll and see the bottom of it.

swagger

The library injects itself into a DOM element <div id="swagger-editor"></div>.

I've tried all kinds of absolute positions and whatnot, and while the editor is in the correct place on the page, the scroll never works correctly.

The scroll only works if I leave the library alone and it fills the whole page.

How can I place the editor where I want?

0

There are 0 answers