blueswen / mkdocs-swagger-ui-tag

A MkDocs plugin supports adding Swagger UI to the page.
https://blueswen.github.io/mkdocs-swagger-ui-tag/
MIT License
75 stars 7 forks source link

Confusing position of the OAuth popup dialog #5

Closed robvanderleek closed 1 year ago

robvanderleek commented 2 years ago

In the plain generated Swagger documentation the authorization dialog is positioned at the top of the page:

swagger-docs

However, in the mkdocs embedded Swagger documentation the authorization dialog is centered in the iframe:

swagger-mkdocs

This behaviour can be confusing to users as they need to scroll down after clicking the Authorize button to find the popup.

Not sure if this behaviour can be changed/configured, let me know if I need to supply more details.

blueswen commented 1 year ago

Hi @robvanderleek,

I added some script to control the authorize modal position when the page is scrolling. The authorize modal will try to stay at the vertical center of the whole window, but it will stick to the top or bottom of the iframe when the iframe is not in the window.

You can check this feature in v0.4.3 or the live demo in https://blueswen.github.io/mkdocs-swagger-ui-tag/demo/multiple/, which also shows it works with multiple Swagger UI opening authorize modal at the same time.

robvanderleek commented 1 year ago

Hi @blueswen

That's just perfect 🤩

That solves the last issue I had embedding the Swagger docs in mkdocs, thanks for all the support.