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

iframe resizing breaks with instant navigation #9

Closed
andreasknoepfle opened this issue Jan 10, 2023 · 2 comments
Closed

iframe resizing breaks with instant navigation #9

andreasknoepfle opened this issue Jan 10, 2023 · 2 comments

Comments

@andreasknoepfle
Copy link

When turning on instant loading from mkdocs material and the first page that is visited does not contain any swagger ui tags, the resize handler breaks, since the function is not defined on the parent page.

plugins:
  - swagger-ui-tag

theme:
  name: material
  features:
    - navigation.instant

This is the error that is raised:

Uncaught TypeError: parent.update_swagger_ui_iframe_height is not a function
    at ResizeObserver.<anonymous> (swagger-df07ce82.html:69:14)

It is not a race condition, since the update_swagger_ui_iframe_height is never defined. Once a full page refresh is done, the function is there again, and subsequent pages will have it.

The current workaround for us is to disable navigation.instant, but could this be solved in a better way?

Thanks for creating this 💚

Cheers
Andi

@blueswen
Copy link
Owner

@andreasknoepfle Sorry for the late reply, this has been fixed in the newest version(v0.5.2). Could you check if this does solve your document error?

@andreasknoepfle
Copy link
Author

Hello @blueswen

just tested it out again and it works like a charm 💚

Thank you very much

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

2 participants